[Haskell-cafe] On to applicative
michael rice
nowgate at yahoo.com
Tue Aug 31 20:48:09 EDT 2010
Thanks, Brandon, but Ryan gave me what I was looking for.
Michael
--- On Tue, 8/31/10, Brandon S Allbery KF8NH <allbery at ece.cmu.edu> wrote:
From: Brandon S Allbery KF8NH <allbery at ece.cmu.edu>
Subject: Re: [Haskell-cafe] On to applicative
To: haskell-cafe at haskell.org
Date: Tuesday, August 31, 2010, 4:35 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 8/31/10 13:27 , michael rice wrote:
> So it's a type constructor, not a type? Could you please provide a simple
> example of its usage?
Assuming you don't mean the trivial use in defining functions, see
Control.Monad.Instances:
> instance Functor ((->) r) where
> fmap = (.)
>
> instance Monad ((->) r) where
> return = const
> f >>= k = \ r -> k (f r) r
(The above is the primitive reader functor/monad, see Control.Monad.Reader
for more information.)
- --
brandon s. allbery [linux,solaris,freebsd,perl] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
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/
iEYEARECAAYFAkx9Z4EACgkQIn7hlCsL25WgrwCgvFQlObavv1fNOaKDjB/qbk8t
8+IAoLUrenXFzZFfJoYYvSy00uPctnaE
=ljiY
-----END PGP SIGNATURE-----
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100831/0664dd8b/attachment.html
More information about the Haskell-Cafe
mailing list