<div dir="ltr">Hello,<div></div><div><br></div><div>these two instances really should be rejected as they violate the FD of the class: we can derive `TypeEq a a True` using the first instance and `TypeEq a a False` using the second one.  Unfortunately, the check that we are using to validate FDs when `UndecidableInstances` is on, is not quite correct (relevant tickets are #9210 and #10675 where there are similar examples).</div><div><br></div><div>-Iavor</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 16, 2017 at 12:13 AM, Anthony Clayden <span dir="ltr"><<a href="mailto:anthony_clayden@clear.net.nz" target="_blank">anthony_clayden@clear.net.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">--ghc 7.10 or 8.0.1<br>
<br>
{-# LANGUAGE DataKinds, KindSignatures, GADTs,<br>
                          MultiParamTypeClasses,<br>
FunctionalDependencies, FlexibleInstances,<br>
                          UndecidableInstances,<br>
NoOverlappingInstances   #-}<br>
<br>
class TypeEq a a' (b :: Bool) | a a' -> b<br>
<br>
instance (b ~ True) => TypeEq a a b<br>
instance (b ~ False) => TypeEq a a' b<br>
<br>
Those two instance heads are nearly identical, surely they<br>
overlap?<br>
And for a type-level type equality test, they must be<br>
unifiable.<br>
But GHC doesn't complain.<br>
<br>
If I take off the FunDep, then GHC complains.<br>
<br>
AFAICT none of those extensions imply Overlaps,<br>
but to be sure I've put NoOverlapping.<br>
<br>
<br>
AntC<br>
______________________________<wbr>_________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.<wbr>org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/glasgow-<wbr>haskell-users</a><br>
</blockquote></div><br></div>