News for hackers. Stuff that matters.
Re:Monads in JavaScript by pdpi on Tuesday July 21, 2015 @07:04AM (#9921426)
First three lines could just be written using applicatives only:

(+) <$> 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.

Re:Monads in JavaScript by tel on Tuesday July 21, 2015 @09:41AM (#9922154)
It's really the add function, strangely, which is monadic here.

Or the whole thing is an applicative if you take at face value his claim that add is pure.