Skip to content

Allow named defaults for poly-kinded (unary) classes

sheaf requested to merge sheaf/ghc:T25882 into master

Ticket: #25882 (closed)

With this MR, we now accept named default declarations for poly-kinded classes such as Typeable, e.g.

default Typeable (Char)

This used to fail because we assumed the kind of the class was monomorphic, e.g.

  • Type -> Constraint
  • (Type -> Type) -> Constraint
  • Nat -> Constraint

Now, we can handle a simple polymorphic class such as Typeable :: forall k. k -> Constraint.

Note that we keep the restriction that the class must only have one visible argument.

Edited by sheaf

Merge request reports

Loading