Skip to content

can newtype be extended to permit GADT-like declarations

I'd like to create the following value constructor without the overhead of data:

data B n e x where
  B :: Body n -> B n C C

However, if I ask for newtype instead of data I'm told that a newtype constructor must have a return type of form T a1 ... an. Is this restriction fundamental? If not, could it be possible to allow GADT-like declarations for newtype?

Trac metadata
Trac field Value
Version 6.12.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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