Error GHC-91510: illegal polymorphic type
Haskell Community [Unofficial]
June 21, 2026
If you extract it to a type synonym you get a more informative error message:
type Foo :: (k -> k -> Type) -> (k -> Type) -> Constraint
type Foo cat f = forall x. Objects cat (f x)
T2.hs:28:1: error: [GHC-02550]
• Quantified predicate must have a class or type variable head:
forall (x :: k). Objects cat (f x)
• In the quantified constraint ‘forall (x :: k). Objects cat (f x)’
In the type synonym declaration for ‘Foo’
|
28 | type Foo cat f = forall x. Objects cat (f x)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Discussion in the ATmosphere