<p dir="ltr">I'm pretty sure we *could*, but special case hacks in the type checker are horrible. So we shouldn't.</p>
<div class="gmail_quote">On Jun 10, 2016 11:13 AM, "Edward Z. Yang" <<a href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Excerpts from Brendan Hay's message of 2016-06-10 01:59:51 -0700:<br>
> * How does the use of ($) vs (.) fix this particular issue? (I'd naively<br>
> assume the usage here would be equivalent.) I recall reading about ($)'s<br>
> magical type alias somewhere - is this related?<br>
<br>
When you say f $ a, where a is a polymorphic variable, we need to<br>
instantiate the type variables in ($) :: (a -> b) -> a -> b with<br>
quantified types; i.e., do an impredicative instantiation.  GHC has<br>
never been able to do this, so there's a hack for the typechecker<br>
to treat 'f $ a' as if it were just 'f a' (no more impredicative<br>
instantiation).<br>
<br>
(.) is not special cased similarly, which is why it doesn't work.<br>
I don't know if we could special case it to solve this problem.<br>
<br>
Edward<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><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>
</blockquote></div>