[Haskell-cafe] How to expose if a constraint is satisfiable

Brandon Allbery allbery.b at gmail.com
Tue May 8 03:58:17 UTC 2018


On Mon, May 7, 2018 at 11:45 PM, Clinton Mead <clintonmead at gmail.com> wrote:

> instance {-# OVERLAPPABLE #-} Num x => C x where ...
> instance {-# OVERLAPPING #-} C Int where ...
>
> is completely legal, and the instance used depends on context.
>
> This is an issue with overlapping instances, but already GHC allows it. I
> don't think what I'm proposing is any worse to what's already legal.
>

Int can be verified as more specific than "matches any type". Two instance
heads differing *only* in context cannot.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180507/e3be6668/attachment.html>


More information about the Haskell-Cafe mailing list