Skip to content

Surprising accepted constructor for GADT instance of data family

-- Accepted:
data family Foo (x :: *) :: * -> *
data instance Foo Int Char where
  Foo :: Foo Int Char

-- Not accepted
data Bar Char where
  Bar :: Bar Char

It seems the second example, using a simple GADT, is syntactically barred from having a specific type constructor in its "head". That syntactic restriction is relaxed, however, for all arguments of the data instance, even though I'd expect it only for the first argument.

Trac metadata
Trac field Value
Version 7.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information