Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unapplied meta-functions should be eagerly applied #126

Open
eelcovisser opened this issue Nov 13, 2016 · 2 comments
Open

Unapplied meta-functions should be eagerly applied #126

eelcovisser opened this issue Nov 13, 2016 · 2 comments

Comments

@eelcovisser
Copy link
Contributor

Meta-function is not lifted from map construction in following rule:

  E |- bindVar(x, v) --> {x |--> allocate(v), E}.
@vvergu
Copy link
Member

vvergu commented Nov 14, 2016

This is a bit trickier to fix. It's not limited to meta-functions, but meta-functions are corner case.

In your example you want an arrow coercion to take place inside a map. The difficulty is that the type mismatch is not local to the term x |--> allocate(v), which is a valid term. The mismatch appears between the term x |--> allocate(v) and E and so you need an arrow coercion Map(String, allocate__meta) --> Map(String, V).

In this particular example the correct outcome is to eagerly reduce all meta-functions which are not explicitly reduced.

I think the editor behavior is correct for the the general case when allocate(v) is not a meta-function.

@vvergu vvergu added this to the Enhancements sprint milestone Nov 14, 2016
@vvergu vvergu changed the title meta-function not lifted from map construction Unapplied meta-functions should be eagerly applied Nov 14, 2016
@eelcovisser
Copy link
Contributor Author

This is not a case of a coercion. Applications of meta-functions need to be lifted out of term construction in general. This is a different transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants