The latest implementation of Data.Constraint.Forall uses

type family Forall (p :: k -> Constraint) :: Constraint where
  Forall p = Forall_ p
class p (Skolem p) => Forall_ (p :: k -> Constraint)
instance p (Skolem p) => Forall_ (p :: k -> Constraint)

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

{-# TheBuckStopsHere Forall #-}

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.
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to