Skip to content

Improved skolem escape check#2643

Merged
paf31 merged 2 commits intomasterfrom
phil/2567-2
Feb 11, 2017
Merged

Improved skolem escape check#2643
paf31 merged 2 commits intomasterfrom
phil/2567-2

Conversation

@paf31
Copy link
Copy Markdown
Contributor

@paf31 paf31 commented Feb 9, 2017

Fixes #2567 and #2310.

Here is an example of the new error message:

Error found:
in module Main
at examples/failing/SkolemEscape2.purs line 8, column 10 - line 10, column 8

  The type variable h, bound at

    examples/failing/SkolemEscape2.purs line 9, column 14 - line 9, column 26

  has escaped its scope, appearing in the type
                                              
    (STRef h0 Int -> Eff t5 Int) -> Eff t5 Int
                                              
in the expression (bind bindEff) (runST (newSTRef 0))
in value declaration test

@hdgarrood
Copy link
Copy Markdown
Contributor

Nice!

@paf31 paf31 changed the base branch from master to phil/1110 February 10, 2017 19:35
@paf31 paf31 changed the base branch from phil/1110 to master February 10, 2017 19:36
@paf31
Copy link
Copy Markdown
Contributor Author

paf31 commented Feb 11, 2017

Does this look ok to merge?

@garyb
Copy link
Copy Markdown
Member

garyb commented Feb 11, 2017

I think so... I didn't see anything wrong in the code, but my review was pretty superficial. The new errors look awesome! Does the package set / Halogen, etc. still compile?

@paf31
Copy link
Copy Markdown
Contributor Author

paf31 commented Feb 11, 2017

I tested Halogen but not the whole package set. Let me see ...

@garyb
Copy link
Copy Markdown
Member

garyb commented Feb 11, 2017

If Halogen passes it's probably fine, it's probably one of the harder tests due to the great deal of existentials 😄. I guess maybe lensy things would be the only other thing potentially tripped up by it?

@paf31
Copy link
Copy Markdown
Contributor Author

paf31 commented Feb 11, 2017

Well Thermite is okay too, which uses lenses quite a bit. But I'll test the package set anyway. All 148 packages is probably a pretty thorough test :)

@paf31
Copy link
Copy Markdown
Contributor Author

paf31 commented Feb 11, 2017

@garyb Everything builds, except for Data.StrMap, but that's because it actually contains some escaped skolems 😄

The error is this:

Error found:
in module Data.StrMap
at /private/tmp/x/.psc-package/psc-0.10.6/maps/v2.1.1/src/Data/StrMap.purs line 169, column 14 - line 169, column 42

  The type variable h, bound at

    /private/tmp/x/.psc-package/psc-0.10.6/maps/v2.1.1/src/Data/StrMap.purs line 169, column 21 - line 169, column 42

  has escaped its scope, appearing in the type
                             
    forall h e.              
      STStrMap h a24         
      -> Eff                 
           ( st :: ST h      
           | e               
           )                 
           (STStrMap h26 a24)
                             

in the expression \s ->           
                    ((poke s) k) v
in value declaration insert

and you can fix it by inserting a few voids in insert and similar functions. Since this won't go out until 0.11, I think that's probably okay since we can make a new release of maps. Right?

@garyb
Copy link
Copy Markdown
Member

garyb commented Feb 11, 2017

Yeah, I think we have a bunch of breaking changes in the core libs queued up, so makes sense to do that with 0.11 :)

@garyb
Copy link
Copy Markdown
Member

garyb commented Feb 11, 2017

Oh, if it doesn't need a breaking change, but just a fix before this goes out - even better.

@paf31 paf31 merged commit 563b8e2 into master Feb 11, 2017
@paf31 paf31 deleted the phil/2567-2 branch February 11, 2017 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants