Skip to content

Lift the "Illegal polymorphic type" restriction on type families

Currently, I can do this:

type Foo = forall a. Maybe a

But if I try to refactor this to an equivalent type family:

type family Foo where
  Foo = forall a. Maybe a

Then GHC complains:

    • Illegal polymorphic type: forall a. Maybe a
    • In the equations for closed type family ‘Foo’
      In the type family declaration for ‘Foo’

We should lift this restriction. This would be necessary, for instance, to implement #11962.

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