How does the ambiguity check work

Nicolas Frisby nicolas.frisby at gmail.com
Mon Sep 30 21:22:53 UTC 2019


IIUC Jan is working on a ghc branch, not a plugin. But perhaps this ticket
will point in the right direction anyway? HTH.

https://gitlab.haskell.org/ghc/ghc/issues/16639

On Mon, Sep 30, 2019, 01:44 Richard Eisenberg <rae at richarde.dev> wrote:

> Hi Jan,
>
> The ambiguity check has a simple description. To test if a type `ty` is
> ambiguous, do this:
>
> ```
> x :: ty
> x = x
> ```
>
> Iff that type-checks, the type is unambiguous. That's it!
>
> The check does not manufacture a binding `x`, but the implementation runs
> through the type-checking process for a binding just like the one I've
> written here.
>
> In your case, I have two hypotheses:
> 1. Presumably, you have a solver plugin at work. That may explain the
> difference in behavior between the two cases.
> 2. There may be kind variables at work, and these may end up ambiguous.
> It's definitely worth trying with -fprint-explicit-kinds.
>
> I hope this helps!
> Richard
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190930/1295ca1f/attachment.html>


More information about the ghc-devs mailing list