[GHC] #10524: PolyKinds doesn't interact well with DeriveFunctor
GHC
ghc-devs at haskell.org
Mon Jun 29 08:50:38 UTC 2015
#10524: PolyKinds doesn't interact well with DeriveFunctor
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #10561 | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by simonpj):
OK, so I fixed comment:7. But the original bug report remains
{{{
newtype Compose f g a = Compose (f (g a)) deriving Functor
}}}
should be fine, but elicits
{{{
T10524.hs:5:52: error:
Couldn't match kind ‘k’ with ‘*’
arising from the first field of ‘Compose’ (type ‘f (g a)’)
When deriving the instance for (Functor (Compose f g))
}}}
After all, this explicit instance declaration typechecks fine
{{{
instance (Functor f, Functor g) => Functor (Compose f g) where
fmap fn (Compose x) = Compose (fmap (fmap fn) x)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10524#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list