3 ms·
Haskell does have "fail" as part of the Monad typeclass. But it is being depreciated and moved into the MonadFail class. Haskell's Monad also has >> and >>= bo
by gizmo686 10y ago
Haskell does have "fail" as part of the Monad typeclass. But it is being depreciated and moved into the MonadFail class.
Haskell's Monad also has >> and >>= both defined as part of the typeclass itself; instead of making >> a normal function. The typeclass does provide a default implementation of >> in terms of >>=.
But you are correct. In general all you need for a monad is bind and return.
http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Monad http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude...
- platz 10y agoThat's all you need to make the compiler happy, but it's not a monad without satisfying the laws too