Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Monads in JavaScript. Parent comment
(+) <$> readLn <> readLn
The monadic part only comes into play in the last line:
(+) <$> readLn <> readLn >>= print
It's part of what makes it monadic that the action takes an argument.
Or the whole thing is an applicative if you take at face value his claim that add is pure.
(+) <$> readLn <> readLn
The monadic part only comes into play in the last line:
(+) <$> readLn <> readLn >>= print
It's part of what makes it monadic that the action takes an argument.