<div dir="ltr">GHCi 8.2.1.</div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-21 10:48 GMT+03:00 Dmitry Olshansky <span dir="ltr"><<a href="mailto:olshanskydr@gmail.com" target="_blank">olshanskydr@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello cafe!<div><br></div><div>It seems that this behavior is wrong:</div><div><br></div><div>> class Foo a where { type Bar a; baz :: a -> Bar a }<br></div><div>> baz zzz         -- zzz is not in scope<br></div><div><div><interactive>:17:1: error:</div><div>    • Couldn't match expected type ‘Bar a’ with actual type ‘Bar a0’</div><div>      NB: ‘Bar’ is a type function, and may not be injective</div><div>      The type variable ‘a0’ is ambiguous</div><div>    • In the ambiguity check for the inferred type for ‘it’</div><div>      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes</div><div>      When checking the inferred type</div><div>        it :: forall a. Bar a</div></div><div><br></div><div>As opposite - correct behavior:</div><div>> :t negate</div><div>negate :: Num a => a -> a<br></div><div>> negate zzz</div><div><interactive>:19:8: error: Variable not in scope: zzz<br></div><div><br></div><div>Best regards,</div><div>Dmitry</div></div>
</blockquote></div><br></div>