Show HN: I built a poker site with Haskell
11–20 of 121 posts
Re: Show HN: I built a poker site with Haskell
#12Re: Show HN: I built a poker site with Haskell
#13Earlier quoted context omitted.
Haskell is dense. I'm picking it up now[0], so this project was very useful for me to see how some "real world" Haskell is written. But yes, take for example this function getSocketAPIPort :: Int -> IO Int getSocketAPIPort defaultPort = do maybeEnvPort return defaultPort Just port -> maybe (return defaultPort) return (readMaybe port) It gets a port from an environment variable, if it can, otherwise a default port. Co…
Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. Elm is onto something with its obsession with simplicity and lack of features. I go back to old Haskell code and have to completely recredentialize in Haskell before I remember what's going on. I return to old Elm code and need very little ramp up. I'm not making an "Elm > Haskell" a…
Re: Show HN: I built a poker site with Haskell
#14Re: Show HN: I built a poker site with Haskell
#15Earlier quoted context omitted.
Haskell is dense. I'm picking it up now[0], so this project was very useful for me to see how some "real world" Haskell is written. But yes, take for example this function getSocketAPIPort :: Int -> IO Int getSocketAPIPort defaultPort = do maybeEnvPort return defaultPort Just port -> maybe (return defaultPort) return (readMaybe port) It gets a port from an environment variable, if it can, otherwise a default port. Co…
Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. Elm is onto something with its obsession with simplicity and lack of features. I go back to old Haskell code and have to completely recredentialize in Haskell before I remember what's going on. I return to old Elm code and need very little ramp up. I'm not making an "Elm > Haskell" a…
I needed the explanation to understand what the code snippet was doing. Careful with those generalisations.
Re: Show HN: I built a poker site with Haskell
#16So, I know literally nothing about Haskell, and I would rate my knowledge of functional programming theory as 'beginner' at best, but I still get baffled every time when reading Haskell code that implements anything other than something trivial like a fibonacci sequence. The poker server code looks extremely tidy and well engineered, so that can't be the problem, but to me it's utterly incomprehensible. It seems like…
I think part of the problem is that Haskell code can be very terse. When reading Python I expect to be able to easily understand what's going on in a 5 line function because the pythonic style limits what you can do in 5 lines. But in haskell a 5 line function can be pretty sophisticated.
Re: Show HN: I built a poker site with Haskell
#17Earlier quoted context omitted.
Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. Elm is onto something with its obsession with simplicity and lack of features. I go back to old Haskell code and have to completely recredentialize in Haskell before I remember what's going on. I return to old Elm code and need very little ramp up. I'm not making an "Elm > Haskell" a…
> Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. I needed the explanation to understand what the code snippet was doing. Careful with those generalisations.
And you surely can understand that code is trying to read a port or use a default one.
Re: Show HN: I built a poker site with Haskell
#18Earlier quoted context omitted.
Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. Elm is onto something with its obsession with simplicity and lack of features. I go back to old Haskell code and have to completely recredentialize in Haskell before I remember what's going on. I return to old Elm code and need very little ramp up. I'm not making an "Elm > Haskell" a…
Do you have a better example from this code base? I'm looking but unfortunately I'm not seeing anything that isn't either trivial or just a lot of monad stack handling.
Re: Show HN: I built a poker site with Haskell
#19What would be the best IDE/editor for Haskell?
Otherwise you can also integrate a language server with Vim or Emacs.
Re: Show HN: I built a poker site with Haskell
#20Earlier quoted context omitted.
> Though notice that you picked literally the most trivial example in the entire codebase that anyone can understand without explanation. I needed the explanation to understand what the code snippet was doing. Careful with those generalisations.
Well, non-programmers are even more helpless in understanding the code, but that's just not the point I'm making. Let's not require everyone to couch every statement in disclaimers, especially such an ancillary one. And you surely can understand that code is trying to read a port or use a default one.
In programming languages which use paradigms I'm more familiar with, yes. In Haskell, not so much, which is the entire point of this thread.