Hacker News new | ask | show | jobs
by koloron 3783 days ago
Didn't downvote, just FYI: Haskell's Applicative is a superclass of Monad now.
1 comments

Which means you are now forced to write the boilerplate

pure = return

(<*>) = liftM2 ($)

In Scala, you get it for free for any monad.

Since GHC-7.10, the minimal complete definition for a Monad instance has been (>>=) (bind) only. So you can simply move the old definition for "return" into the Applicative instance as "pure" and you're good.