<div dir="ltr">Yeah, this should work with UndecidableInstances.  The reason you need that extension is that if we consider the context, then there are some pathological examples that can make GHC's instance checking algorithm go forever.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 31, 2015 at 9:56 AM, Gabor Greif <span dir="ltr"><<a href="mailto:ggreif@gmail.com" target="_blank">ggreif@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No. I'll switch that on and report back.<div><br></div><div>Thanks,</div><div><br></div><div>    Gabor<div><div class="h5"><br><br>Em sexta-feira, 31 de julho de 2015, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">you need "liberal coverage checking", so UndecidableInstances. Are you doing that?<br>
<br>
|  -----Original Message-----<br>
|  From: ghc-devs [mailto:<a>ghc-devs-bounces@haskell.org</a>] On Behalf Of<br>
|  Richard Eisenberg<br>
|  Sent: 31 July 2015 16:10<br>
|  To: Gabor Greif<br>
|  Cc: ghc-devs<br>
|  Subject: Re: Fundep question<br>
|<br>
|  Let's rewrite with explicit kind variables, noting that b is also<br>
|  poly-kinded:<br>
|<br>
|  class Dep k k2 (a :: k) (b :: k2) | a -> b k2<br>
|      -- if a determines b, it surely determines k2<br>
|<br>
|  instance Dep k * x y => Dep (Maybe k) * (Just x) (Maybe y)<br>
|<br>
|  Actually, even with the kinds explicit, it still looks valid to me.<br>
|  Post a bug report?<br>
|<br>
|  Richard<br>
|<br>
|  On Jul 31, 2015, at 9:54 AM, Gabor Greif <<a>ggreif@gmail.com</a>> wrote:<br>
|<br>
|  > Hi all,<br>
|  ><br>
|  > say I want to instantiate<br>
|  ><br>
|  >    class Dep (a :: k) b | a -> b<br>
|  ><br>
|  > as<br>
|  ><br>
|  >    instance Dep x y => Dep (Just x) (Maybe y)<br>
|  ><br>
|  > Is this supposed to work? I get "The coverage condition fails"<br>
|  errors.<br>
|  ><br>
|  > For simple cases like<br>
|  ><br>
|  >    instance Dep True Bool<br>
|  ><br>
|  > etc. it seems to work fine.<br>
|  ><br>
|  > Thanks and cheers,<br>
|  ><br>
|  >    Gabor<br>
|  > _______________________________________________<br>
|  > ghc-devs mailing list<br>
|  > <a>ghc-devs@haskell.org</a><br>
|  > <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
|<br>
|  _______________________________________________<br>
|  ghc-devs mailing list<br>
|  <a>ghc-devs@haskell.org</a><br>
|  <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div></div></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>