[GHC] #8486: cannot derive new-typeable instances for promoted data types taking parameters
GHC
ghc-devs at haskell.org
Wed Oct 30 02:48:31 UTC 2013
#8486: cannot derive new-typeable instances for promoted data types taking
parameters
------------------------------------+-------------------------------------
Reporter: aavogt | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
Hi,
The following code shows the issue:
{{{
{-# LANGUAGE DataKinds, DeriveDataTypeable, KindSignatures, PolyKinds,
StandaloneDeriving #-}
import Data.Typeable
import GHC.TypeLits
data T (a :: [*]) = T deriving (Typeable)
t = T :: T [Int, Double]
deriving instance Typeable '[]
{-
*Main> typeOf t
<interactive>:24:1:
No instance for (Typeable (* -> [*] -> [*]) ((':) *))
arising from a use of ‛typeOf’
In the expression: typeOf t
In an equation for ‛it’: it = typeOf t
-}
}}}
ghc7.7-20131004 doesn't allow either of the following:
{{{
deriving instance (Typeable a, Typeable b) => Typeable (a ': b)
-- or
deriving instance Typeable (':)
}}}
On ghc-7.6 I could write my own `instance Typeable (T a)`, but this has
been disabled it seems.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8486>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list