HaskellWiki

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

 

Not logged in
Log in | Help

Note: new account creation has been disabled as an anti-spam measure.

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://haskell.cs.yale.edu/haskellwiki/Functor"

This page has been accessed 6,481 times. This page was last modified 02:34, 31 July 2008. Recent content is available under a simple permissive license.