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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Frisby
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 <[hidden email]> 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

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Frisby
Whoops, I replied via email instead of commenting on the ticket. I've done so now. Sorry for the mailing list noise.

On Mon, Jun 11, 2018, 08:21 Nicolas Frisby <[hidden email]> wrote:
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 <[hidden email]> 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

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs