ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Class: Functor
Instances: [], IO, Maybe

class  Functor f  where
    fmap              :: (a -> b) -> f a -> f b

instance Functor Maybe where

    fmap f Nothing    =  Nothing
    fmap f (Just x)   =  Just (f x)

instance Functor IO where

   fmap f x           =  x >>= (return . f)

instance Functor [] where

    fmap = map