make some Applicative functions into methods, and split off Data.Functor (proposal...
[ghc-base.git] / Data / Functor.hs
1 -----------------------------------------------------------------------------
2 -- |
3 -- Module      :  Data.Functor
4 -- Copyright   :  (c) The University of Glasgow 2001
5 -- License     :  BSD-style (see the file libraries/base/LICENSE)
6 -- 
7 -- Maintainer  :  libraries@haskell.org
8 -- Stability   :  provisional
9 -- Portability :  portable
10 --
11 -- Functors: uniform action over a parameterized type, generalizing the
12 -- 'map' function on lists.
13
14 module Data.Functor
15     (
16       Functor(fmap, (<$)),
17       (<$>),
18     ) where
19
20 #ifdef __GLASGOW_HASKELL__
21 import GHC.Base (Functor(..))
22 #endif
23
24 infixl 4 <$>
25
26 -- | An infix synonym for 'fmap'.
27 (<$>) :: Functor f => (a -> b) -> f a -> f b
28 (<$>) = fmap