ambiguous type stuff

David Kraeutmann kane at kane.cx
Sun Dec 6 01:43:52 UTC 2015


Oh, you meant that kind of ambiguous type (I thought you meant the (show.read) kind of ambiguity).
So you'd like -XAllowAmbiguousTypes to be on by default?

On 12/6/2015 2:16 AM, David Feuer wrote:
> I think I didn't explain myself well enough. I'm not talking about expanded
> defaulting, although that may be tied up with the same mechanisms. Perhaps
> the best thing is just to work on the error message text for certain
> ambiguous type situations. Notably, situations where adding a proxy
> argument or similar is needed to avoid the error tend to be pretty
> mysterious until you realize that the system is not complaining because it
> can't determine a type, but rather because there is no way to pinpoint that
> type at the use site.
>
> If F is a type family then
>
> f :: Foo x => F x
>
> has a perfectly sensible translation, namely
>
> f :: forall x . Foo x -> F x
>
> The problem is purely one of inference on the Haskell side: there is no way
> to add a signature *at the call site* that determines what value of x to
> pass to f. The error message about x being ambiguous because F is a type
> family has to be read a bit backwards. At a *use site*, it'll be pretty
> clear-cut what's ambiguous, and it will soon become clear why it can't be
> pinned down. Perhaps it would pay to change the error message to explain
> why the type signature renders the term unusable.
>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4291 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151206/0948ee44/attachment.bin>


More information about the ghc-devs mailing list