Constraint Kinds don't work with Template Haskell
If I have a record with a constraint kind that has multiple constraints such as:
type MyConstraint a = (Show a, Eq a, Typeable a)
data MyConstraint a => MyType a = MyType {
someField :: a
}
If I try to use template haskell on the type (in my case mkLabels from fclabels) you get the following error: Can't represent tuple predicates in Template Haskell: MyConstraint a
Complete Repro Case:
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DatatypeContexts #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TemplateHaskell #-}
import Data.Label
import Data.Typeable
type MyConstraint a = (Show a, Eq a, Typeable a)
data MyConstraint a => MyType a = MyType {
myField :: a
} deriving (Show, Eq)
mkLabels [''MyType]
Trac metadata
Trac field | Value |
---|---|
Version | 7.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |