
31 Jul
2010
31 Jul
'10
4:03 a.m.
Brandon S Allbery KF8NH wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 7/30/10 11:48 , Ivan Lazar Miljenovic wrote:
it's a bit hidden in Haskell, but a monad instance consists of three functions:
fmap :: (a -> b) -> (m a -> m b) You don't even need fmap defined for it to be a monad, since fmap f m =
Ertugrul Soeylemez
writes: liftM f m = m >>= (return . f) fmap/join and return/bind are isomorphic; given either set, you can produce the other.
No. fmap+join is isomorphic to bind. Your options are (fmap,return,join) or (return,bind). There is no way to get by without the return, since that's the natural transformation necessary for entering the monad in the first place. -- Live well, ~wren