<div dir="ltr"><div><div><div>Hi Wolfgang,<br><br></div><a href="https://ghc.haskell.org/trac/ghc/ticket/10009">https://ghc.haskell.org/trac/ghc/ticket/10009</a> might be the same regression (fixed in HEAD)<br><br></div>Regards,<br></div>Adam<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 2, 2015 at 12:28 PM, Wolfgang Jeltsch <span dir="ltr"><<a href="mailto:g9ks157k@acme.softbase.org" target="_blank">g9ks157k@acme.softbase.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
the following (contrived) code is accepted by GHC 7.8.3, but not 7.10.1:<br>
<br>
> {-# LANGUAGE TypeFamilies #-}<br>
><br>
> type family F a :: *<br>
><br>
> type family G b :: *<br>
><br>
> x :: G (F a) ~ a => F a<br>
> x = undefined<br>
<br>
GHC 7.10.1 reports:<br>
<br>
> Could not deduce (F a0 ~ F a)<br>
> from the context (G (F a) ~ a)<br>
>   bound by the type signature for x :: (G (F a) ~ a) => F a<br>
>   at Test.hs:7:6-23<br>
> NB: ‘F’ is a type function, and may not be injective<br>
> The type variable ‘a0’ is ambiguous<br>
> In the ambiguity check for the type signature for ‘x’:<br>
>   x :: forall a. (G (F a) ~ a) => F a<br>
> To defer the ambiguity check to use sites, enable AllowAmbiguousTypes<br>
> In the type signature for ‘x’: x :: G (F a) ~ a => F a<br>
<br>
At a first look, this complaint seems reasonable, and I have already<br>
wondered why GHC 7.8.3 actually accepts the above code.<br>
<br>
>From an intuitive standpoint, however, the code seems actually<br>
acceptable to me. While it is true that type families are generally not<br>
injective, it is possible to derive the type a from F a by applying G.<br>
<br>
It would great if this code would be accepted by GHC again and if there<br>
was a workaround to make it work with GHC 7.10.1. At the moment, this<br>
change in the type checker from 7.8.3 to 7.10.1 breaks the<br>
incremental-computing package in a rather fundamental way.<br>
<br>
All the best,<br>
Wolfgang<br>
<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users</a><br>
</blockquote></div><br></div>