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

Restructure recursors and add some lens interfaces #1489

Merged
merged 2 commits into from
Aug 30, 2022
Merged

Conversation

janmasrovira
Copy link
Collaborator

This PR restructures the recursors in two categories: Applicative and Monadic.
In Applicative we find folds and maps to the leaves. In Monadic we find maps (top-down and bottom-up).
The advantage of having Applicative folds is that they can play well with some lens interface (e.g. Traversal, SimpleFold).
As an illustrative example, this PR implements a SimpleFold over free variables inside a node, and a Traversal over all the identifiers. One can then easily use the existing tools from the lens ecosystem to define a function to determine whether a node is closed, as shown in this PR.

Having a lens interface is not always possible, however, I think that for the cases where it is, we should try to have it.

@lukaszcz lukaszcz self-requested a review August 30, 2022 15:23
@lukaszcz lukaszcz merged commit e24cc62 into main Aug 30, 2022
@lukaszcz lukaszcz deleted the lens-recursors branch August 30, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to JuvixCore refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants