Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Implementing 2048 in 90 lines of Haskell. Parent comment
As for `>>=` (also known as `bind`), I'm using it as a more generic version of `concatMap`. The following expressions are basically the same:
concat (map (\ x -> [x, -x]) [1, 2, 3]) concatMap (\ x -> [x, -x]) [1, 2, 3] [1, 2, 3] >>= \ x -> [x, -x]
[1]: http://learnyouahaskell.com/a-fistful-of-monads
There are no comments on this comment yet.
As for `>>=` (also known as `bind`), I'm using it as a more generic version of `concatMap`. The following expressions are basically the same:
If you want to learn more, check out LYAH [1].[1]: http://learnyouahaskell.com/a-fistful-of-monads