patch applied (packages/base): make some Applicative functions into
methods, and split off Data.Functor (proposal #3335)
Ross Paterson
ross at soi.city.ac.uk
Wed Sep 16 03:26:16 EDT 2009
Tue Sep 15 10:31:09 PDT 2009 Ross Paterson <ross at soi.city.ac.uk>
* make some Applicative functions into methods, and split off Data.Functor (proposal #3335)
Ignore-this: a0cff4de6dfdbcbd56a66101bc4855a9
The following functions
(<$) :: Functor f => a -> f b -> f a
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
are moved into the corresponding classes, with the existing implementations
as default definitions. This gives people creating instances the option of
defining specialized implementations of these functions, though they should
be equivalent to the default definitions.
Although (<$) is now a method of the Functor class, it is hidden in the
re-export by the Prelude, Control.Monad and Monad. The new module
Data.Functor exposes the full class, plus the function (<$>). These are
also re-exported by Control.Applicative.
M ./Control/Applicative.hs -31 +39
A ./Data/Functor.hs
M ./GHC/Base.lhs +7
M ./base.cabal +1
View patch online:
http://darcs.haskell.org/packages/base/_darcs/patches/20090915173109-b47d3-84aac5dec45fe499884bf84a79213baecb65b53a.gz
More information about the Cvs-libraries
mailing list