GHCi 8.2.1.

2017-11-21 10:48 GMT+03:00 Dmitry Olshansky <olshanskydr@gmail.com>:
Hello cafe!

It seems that this behavior is wrong:

> class Foo a where { type Bar a; baz :: a -> Bar a }
> baz zzz         -- zzz is not in scope
<interactive>:17:1: error:
    • Couldn't match expected type ‘Bar a’ with actual type ‘Bar a0’
      NB: ‘Bar’ is a type function, and may not be injective
      The type variable ‘a0’ is ambiguous
    • In the ambiguity check for the inferred type for ‘it’
      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
      When checking the inferred type
        it :: forall a. Bar a

As opposite - correct behavior:
> :t negate
negate :: Num a => a -> a
> negate zzz
<interactive>:19:8: error: Variable not in scope: zzz

Best regards,
Dmitry