#2176: H98 module Array exports non-H98 instance Functor ((->) a)
------------------------------------+---------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/haskell98 | Version: 6.8.2
Severity: normal | Resolution:
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
------------------------------------+---------------------------------------
Comment (by claus):
Replying to [ticket:2176 duncan]:
> Tracking down the source of instances is quite tricky. I wonder if there
is anything we can do to make it easier? I was using ghc --show-iface on
all the imports to try and find it.
use ghci and :info?
{{{
GHCi, version 6.9.20080217: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :i Functor
class Functor f where fmap :: (a -> b) -> f a -> f b
-- Defined in GHC.Base
instance Functor Maybe -- Defined in Data.Maybe
instance Functor [] -- Defined in GHC.Base
instance Functor IO -- Defined in GHC.IOBase
Prelude> :m +Data.Array
Prelude Data.Array> :i Functor
class Functor f where fmap :: (a -> b) -> f a -> f b
-- Defined in GHC.Base
instance (Ix i) => Functor (Array i) -- Defined in GHC.Arr
instance Functor ((->) r) -- Defined in Control.Monad.Instances
instance Functor ((,) a) -- Defined in Control.Monad.Instances
instance Functor (Either a) -- Defined in Control.Monad.Instances
instance Functor Maybe -- Defined in Data.Maybe
instance Functor [] -- Defined in GHC.Base
instance Functor IO -- Defined in GHC.IOBase
Prelude Data.Array>
}}}
one problem with this is that instances aren't managed properly in ghci
sessions:
{{{
Prelude Data.Array> :m -Data.Array
Prelude> :i Functor
class Functor f where fmap :: (a -> b) -> f a -> f b
-- Defined in GHC.Base
instance Functor ((->) r) -- Defined in Control.Monad.Instances
instance Functor ((,) a) -- Defined in Control.Monad.Instances
instance Functor (Either a) -- Defined in Control.Monad.Instances
instance Functor Maybe -- Defined in Data.Maybe
instance Functor [] -- Defined in GHC.Base
instance Functor IO -- Defined in GHC.IOBase
Prelude>
}}}
i thought the latter was a known bug, but i can't seem to find the
ticket..
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2176#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs