External Publication
Visit Post

Error GHC-91510: illegal polymorphic type

Haskell Community [Unofficial] June 21, 2026
Source

I’m afraid I still can’t quite make it work:

type Objects :: Type -> (k -> k -> Type) -> k -> Constraint
class Objects bleh cat (x :: k) where
  type ObjectsC cat (x :: k) :: Constraint

type Category :: (k -> k -> Type) -> Constraint
class Category cat where
  id :: (Objects bleh cat x) => cat x x
  (.) ::
    (Objects bleh cat x, Objects bleh cat y, Objects bleh cat z) =>
    cat y z -> cat x y -> cat x z

instance Objects bleh (Transform cat) f where
  type ObjectsC cat f = () -- GHC-25897

The new error text:

• Expecting one more argument to ‘f’
  Expected kind ‘k’, but ‘f’ has kind ‘j -> k’
  ‘k’ is a rigid type variable bound by
    a family instance declaration

However, ObjectsC is indeed expecting f to have kind j -> k.

Discussion in the ATmosphere

Loading comments...