-----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.  The usual category-theory definition of monads uses the former;
Haskell uses the latter, because it allows operations to easily be chained
together.

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      [email protected]
system administrator  [openafs,heimdal,too many hats]  [email protected]
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxS9foACgkQIn7hlCsL25Uc2ACgoLG8uti3d0oWrv1H56fRJ3W4
xZIAn1KotatZklktHpKEwdib6AKXrNOr
=Io9w
-----END PGP SIGNATURE-----
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to