
24 Oct
2015
24 Oct
'15
7:55 a.m.
Hi, I’m reading Typeclassopdedia and an exercise is "A good exercise is to implement Functor instances for Either e, ((,) e), and ((->) e).” so I have instance Functor ((,) a) where fmap = undefined which gives compiler error Duplicate instance declarations: instance Functor ((,) a) -- Defined at /Users/mike/haskell/FingerTrees/M.hs:65:10 instance Functor ((,) a) -- Defined in ‘GHC.Base’ so I added import GHC.Base hiding ((,)) but I still get the error. Where am I going wrong? Many thanks Mike