[GHC] #10524: PolyKinds doesn't interact well with DeriveFunctor
GHC
ghc-devs at haskell.org
Thu Jun 25 22:16:51 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 RyanGlScott):
It looks like {{{PolyKinds}}} also breaks deriving {{{Data}}} instances as
well:
{{{#!hs
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PolyKinds #-}
import Data.Data
newtype WrappedFunctor f a = WrapFunctor (f a) deriving (Data, Typeable)
}}}
This will result in the error:
{{{
No instance for (Typeable a)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Data (WrappedFunctor f a))
}}}
(Presumably, it's trying to infer the instance context {{{Data (f a),
Typeable f, Typeable a) => Data (WrappedFunctor f a)}}}, but can't.)
I'm not sure if this is due to the same underlying issue, but it seems
likely, since that code will compile without {{{PolyKinds}}}. I reproduced
this on GHC 7.8, 7.10, and HEAD.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10524#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list