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