[GHC] #15147: Type checker plugin receives Wanteds that are not completely unflattened

Nicolas Frisby nicolas.frisby at gmail.com
Mon Jun 11 15:21:08 UTC 2018


That way of saying it clarifies the expectations for me. And doesn't seem
too burdensome for the plugin author.

Thus I think this ticket could be resolved by updating the documentation.
(Though I still would like for a plugin to be able to request the flattened
Wanteds. Separate ticket?)

In particular this sentence in the User Guide

"[The plugin] will be invoked at two points in the constraint solving
process: after simplification of given constraints, and after unflattening
of wanted constraints."

would benefit from some elaboration. Specifically, "unflattening of wanted
constraints" is somewhat ambiguous: until you spelled it out, I was
thinking that if a constraint is flattened, it doesn't have any flattening
variables in it. However, I'm inferring here that the jargon is used to
mean that "unflattening a wanted constraint" only eliminates fmvs, possibly
leaving fsks behind? That's what I've been confused about (until now, I
think). Thanks.

On Tue, Jun 5, 2018, 01:48 GHC <ghc-devs at haskell.org> wrote:

> #15147: Type checker plugin receives Wanteds that are not completely
> unflattened
> -------------------------------------+-------------------------------------
>         Reporter:  nfrisby           |                Owner:  (none)
>             Type:  bug               |               Status:  new
>         Priority:  normal            |            Milestone:  8.6.1
>        Component:  Compiler (Type    |              Version:  8.4.1
>   checker)                           |             Keywords:
>       Resolution:                    |  TypeCheckerPlugins
> Operating System:  Unknown/Multiple  |         Architecture:
>                                      |  Unknown/Multiple
>  Type of failure:  None/Unknown      |            Test Case:
>       Blocked By:                    |             Blocking:
>  Related Tickets:                    |  Differential Rev(s):
>        Wiki Page:                    |
> -------------------------------------+-------------------------------------
>
> Comment (by simonpj):
>
>  > Perhaps I'm misunderstanding something
>
>  I didn't express it very clearly.  As it stands, the Given CFunEqCan's
>  remain, and hence so do the fsks.  The Wanted CFunEqCans are removed
>  (currently) along with the fmvs.
>
>  So yes, currently Wanteds can contain fsks, whose definition is given by a
>  CFunEqCan.  I would have thought that most plugins would not find it hard
>  to deal with that.
>
> --
> Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15147#comment:14>
> GHC <http://www.haskell.org/ghc/>
> The Glasgow Haskell Compiler
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180611/0ef717a7/attachment.html>


More information about the ghc-devs mailing list