<p dir="ltr">The latest implementation of Data.Constraint.Forall uses</p>
<p dir="ltr">type family Forall (p :: k -> Constraint) :: Constraint where<br>
Forall p = Forall_ p<br>
class p (Skolem p) => Forall_ (p :: k -> Constraint)<br>
instance p (Skolem p) => Forall_ (p :: k -> Constraint)</p>
<p dir="ltr">The trouble is that errors relating to Forall are reported with Skolem verbiage, making them incomprehensible to users -- the Skolem type family is not exported. It would be nice if GHC could keep track of what led to the p (Skolem p) constraint, and report that. The sanest idea I've come up with thus far is a "buck stops here" pragma. When GHC attempts to solve a constraint so marked, it will hold onto that fact, and report any failures against that. So</p>
<p dir="ltr">{-# TheBuckStopsHere Forall #-}</p>
<p dir="ltr">would make GHC take note when trying to solve Forall p, and report that it failed to solve Forall p, rather than that it failed to solve constraints further down the line.</p>