<div dir="ltr">It looks like you have an infinite loop created, where `hasLens = boolL` and `boolL = hasLens`, and the two overlappable instances are each fulfilling the constraints of the other instance.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 24, 2018 at 12:11 AM Theodore Lief Gannon <<a href="mailto:tanuki@gmail.com">tanuki@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:monospace,monospace">λ. :set -XFlexibleContexts -XFlexibleInstances -XMultiParamTypeClasses -XUndecidableInstances</span><br></div><font face="monospace, monospace">λ. import RIO</font></div><div><font face="monospace, monospace">λ. import Data.Has</font></div><div><font face="monospace, monospace">λ. class HasBool a where boolL :: Lens' a Bool</font></div><div><font face="monospace, monospace">λ. instance {-#OVERLAPPABLE#-} HasBool a => Has Bool a where hasLens = boolL<br></font></div><div><font face="monospace, monospace">λ. instance {-#OVERLAPPABLE#-} Has Bool a => HasBool a where boolL = hasLens</font></div><div><font face="monospace, monospace">λ. runRIO () $ view boolL</font></div><div><font face="monospace, monospace">^CInterrupted.<br></font></div><div><br></div><div>The RIO environment <font face="monospace, monospace">()</font> doesn't contain a Bool. I can see how the typechecker might get lost in this, but I can compile an equivalent program; it loops on execution.</div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>