Skip to content

Levity polymorphism check eliminates non-levity-polymorphic data constructor

When I say

data X where
  MkX :: forall (a :: TYPE r). (a -> a) -> X

I get

    • A representation-polymorphic type is not allowed here:
        Type: a
        Kind: TYPE r
    • In the definition of data constructor ‘MkX’
      In the data type declaration for ‘X’

But that's silly, because the type is not levity-polymorphic!

Trac metadata
Trac field Value
Version 8.0.1
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