Brandon S Allbery KF8NH wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 7/30/10 11:48 , Ivan Lazar Miljenovic wrote:
Ertugrul Soeylemez <[email protected]> writes:
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 =
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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to