
Hi all I read TFM http://haskell.org/ghc/docs/latest/html/libraries/base/ Prelude.html#t%3AFunctor and it does rather suggest that there's an instance of Functor for (Either a). Yet, ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Prelude> fmap not (Right True) <interactive>:1:0: No instance for (Functor (Either a)) arising from use of `fmap' at <interactive>:1:0-20 Am I being dim? Conor

Hi Conor, On Sun, Jul 15, 2007 at 08:20:25PM +0100, Conor McBride wrote:
and it does rather suggest that there's an instance of Functor for (Either a). Yet,
Prelude> fmap not (Right True)
<interactive>:1:0: No instance for (Functor (Either a)) arising from use of `fmap' at <interactive>:1:0-20
It's in Control.Monad.Instances: Prelude> :m + Control.Monad.Instances Prelude Control.Monad.Instances> fmap not (Right True) Right False I don't know if there's a way of deducing that from the haddock documentation. Thanks Ian

Ian Lynagh wrote:
It's in Control.Monad.Instances:
Prelude> :m + Control.Monad.Instances Prelude Control.Monad.Instances> fmap not (Right True) Right False
I don't know if there's a way of deducing that from the haddock documentation.
There doesn't seem to be. I didn't discover that module until I finally sat down and spent 15 minutes trying to answer the question "why is importing, or omitting, some completely unrelated mtl module influencing my program's ability to compile?" Wonderful as haddock is, there's no substitute for having the GHC sources and half of hackage unpacked on your hard disk, to make possible a few rounds of "grep -r".

Hello Bryan, Monday, July 16, 2007, 2:16:17 AM, you wrote:
There doesn't seem to be. I didn't discover that module until I finally sat down and spent 15 minutes trying to answer the question "why is importing, or omitting, some completely unrelated mtl module influencing my program's ability to compile?"
instances are standard answer. they are as viruses, imperceptibly filtering through any import lists :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (4)
-
Bryan O'Sullivan
-
Bulat Ziganshin
-
Conor McBride
-
Ian Lynagh