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

Handle implicit suspension in a more consistent way #35

Open
thibautbenjamin opened this issue Aug 10, 2023 · 0 comments
Open

Handle implicit suspension in a more consistent way #35

thibautbenjamin opened this issue Aug 10, 2023 · 0 comments

Comments

@thibautbenjamin
Copy link
Owner

For now implicit suspensions are handled before the constraint typing algorithm, and very hackish heuristics are used to determine how what to suspend.
This leads to some limitations, for instance, the type comp (assoc f g h) (id _)) -> id _ fails. The reason is that the identity on the RHS cannot infer that it needs a suspension.

#33 introduces constraint typing with meta type variables consistently. We could use this to determine how to implicitly supend in a more consistent way:
If the implicit suspension is activated, when we type by constraint a term of the form coh (ps,ty)[s], instead of giving the result to be ty[s], we change the base * for a meta type variable. Upon resolving, if we find this meta variable to stand for a type dimension k, we suspend the corresponding coherence k times.

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

1 participant