Re:Show HN: I built a poker site with Haskell
by danidiaz on Friday August 09, 2019 @01:17PM
(#20656371)
In your first version, I think I would use =<< to keep "flow" of information right-to-left. I also use parentheses instead of . and $ when there isn't a lot of nesting, I got that habit from this post about writing legible Haskell http://www.haskellforall.com/2015/09/how-to-make-your-haskel...
Keeping the pattern match instead of using "fromMaybe" wouldn't be a bad idea, either:
It makes the default value stand out a bit more.
[ Parent
| on HN ]
Re:Show HN: I built a poker site with Haskell
by nilkn on Friday August 09, 2019 @04:24PM
(#20657982)
I've written a fair bit of Haskell, including some production software. Your second version here is my personal favorite of the variants proposed so far. It's the version I can look at and more or less instantly understand. I think sometimes folks go a little too far with using library functions to manipulate Maybe values -- not that `fromMaybe` is particularly onerous, but something about the structure of pattern matching just conveys information to my brain much faster.