typeable instances incompatible between 7.8 and 7.9
not sure if this is deliberate or by design, but to get some typeable instances happy for some DataKind heavy code, if i wish it to build in both 7.8 and 7.9, i need to write it in the following form
{-# LANGUAGE DataKinds, GADTs, TypeFamilies, TypeOperators,
ConstraintKinds, ScopedTypeVariables, RankNTypes #-}
data Nat = S !Nat | Z
deriving (Eq,Show,Read,Typeable,Data)
#if defined(__GLASGOW_HASKELL__) && ( __GLASGOW_HASKELL__ >= 707) && ( __GLASGOW_HASKELL__ < 709)
deriving instance Typeable 'Z
deriving instance Typeable 'S
#endif
if i omit the latter typeables in 7.8, i can't get typeable instances for Nat indexed data types, but i get a GHC error if i include them in 7.9
Duplicate instance declarations:
instance Typeable 'S -- Defined at src/Numerical/Nat.hs:24:28
instance Typeable 'S -- Defined at src/Numerical/Nat.hs:28:1
src/Numerical/Nat.hs:24:28:
Duplicate instance declarations:
instance Typeable 'Z -- Defined at src/Numerical/Nat.hs:24:28
instance Typeable 'Z -- Defined at src/Numerical/Nat.hs:27:1
https://travis-ci.org/wellposed/numerical/jobs/31011288#L525 for context
I can work around it with CPP, but is this a deliberate change or accidental? (i'm ok with that CPP being there, but would like some confirmation this is a deliberate change)
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |