Deprecate bitSize
[packages/base.git] / Data / Functor.hs
1 {-# LANGUAGE Trustworthy #-}
2 {-# LANGUAGE CPP #-}
3
4 -----------------------------------------------------------------------------
5 -- |
6 -- Module : Data.Functor
7 -- Copyright : (c) The University of Glasgow 2001
8 -- License : BSD-style (see the file libraries/base/LICENSE)
9 --
10 -- Maintainer : libraries@haskell.org
11 -- Stability : provisional
12 -- Portability : portable
13 --
14 -- Functors: uniform action over a parameterized type, generalizing the
15 -- 'map' function on lists.
16
17 module Data.Functor
18 (
19 Functor(fmap),
20 (<$),
21 (<$>),
22 ) where
23
24 #ifdef __GLASGOW_HASKELL__
25 import GHC.Base (Functor(..))
26 #else
27 (<$) :: Functor f => a -> f b -> f a
28 (<$) = fmap . const
29 #endif
30
31 infixl 4 <$>
32
33 -- | An infix synonym for 'fmap'.
34 (<$>) :: Functor f => (a -> b) -> f a -> f b
35 (<$>) = fmap
36