[Haskell-cafe] Missing Functor instances in GHC 7?

Sebastian Fischer fischer at nii.ac.jp
Fri Dec 10 06:10:42 CET 2010


Hello,

according to

http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html

Control.Monad exports 20 Functor instance declarations in base-4.3.0.0.
However:

    bash# ghc-pkg list | grep base
        base-4.3.0.0
    bash# ghci --version
    The Glorious Glasgow Haskell Compilation System, version 7.0.1
    bash# ghci
    Prelude> import Control.Monad
    Prelude Control.Monad> :i Functor
    class Functor f where
      fmap :: (a -> b) -> f a -> f b
      (GHC.Base.<$) :: a -> f b -> f a
  	    -- Defined in GHC.Base
    instance Functor Maybe -- Defined in Data.Maybe
    instance Functor [] -- Defined in GHC.Base
    instance Functor IO -- Defined in GHC.Base

There are only 3 instances instead of 20. Importing Control.Applicative
gives 3 more instances but for example the instance for ((->) r) is
still missing.

Is my installation broken? Or has anybody similar problems finding
Functor instances in GHC 7?

Sebastian




More information about the Haskell-Cafe mailing list