HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Functor

Categories: Standard classes | Monad

Functor class (base)
import Control.Monad

The Functor class is defined like this:

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

All instances of Functor should obey:

fmap id = id
fmap (p . q) = (fmap p) . (fmap q)

Retrieved from "http://www.haskell.org/haskellwiki/Functor"

This page has been accessed 4,335 times. This page was last modified 18:27, 7 October 2006. Recent content is available under a simple permissive license.