<div dir="ltr"><font face="monospace">> <span style="color:rgb(0,0,0);font-size:1em;white-space:pre-wrap">because UndecidableInstances is definitely required for this and I know it's a problematic one.</span></font><div><span style="color:rgb(0,0,0);font-size:1em;white-space:pre-wrap"><font face="monospace"><br></font></span></div><div><span style="color:rgb(0,0,0);font-size:1em;white-space:pre-wrap"><font face="monospace">Hi Juan, I'll knock that on the head at once. `UndecidableInstances` is not "problematic" (or at least it's far less problematic than others you list). Although we're lacking a proof that it can't lead to incoherence/type unsafety, nobody's demonstrated unsafety due to `UndecidableInstances` alone -- that is, providing the program compiles (i.e. instance resolution terminates).</font></span></div><div><span style="color:rgb(0,0,0);font-size:1em;white-space:pre-wrap"><font face="monospace"><br></font></span></div><div><span style="color:rgb(0,0,0);font-size:1em;white-space:pre-wrap"><font face="monospace">OTOH `FlexibleInstances` can give `OverlappingInstances` -- maybe overlapping with those in some other module, thus giving the dreaded Orphan instances problems. I'd be much more concerned about them.</font></span></div><div><br></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">> instance (Ord a, forall b c. (Ord b, Ord c)) => Class1 a where
> fun1 = (<)
</font></pre><font face="monospace"><br class="gmail-Apple-interchange-newline"></font></div><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><span style="font-size:1em">Why does that even mention `b` or `c`? There's no FunDep from `a`, to get a FunDep there'd be a constraint `D a b c` or something. They seem totally redundant.</span><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="font-size:1em"><font face="monospace"><br></font></span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><span style="font-size:1em">> </span>completely overlooked by the compiler</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">Yes. Quite. What do you expect the compiler to do? Even if the class decl gave a signature for `fun1` mentioning `b`, `c`, those would be _distinct_ tyvars, because they're not scoped in the class head.</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">> is there any way I can make this work?</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">Sorry, I don't know what you want to "work". Please at least show a class decl with a FunDep. From your second message:</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">> it is possible in principle that (Ord a, Ord b) produces a functional dependency between a and b</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">No it isn't possible, even in principle: `(..., ...)` is a tuple constructor, not a class; therefore no FunDep could apply.</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace"><br></font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="monospace">AntC</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><br></pre></div>