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

Tree traversal functions #157

Open
koraa opened this issue Feb 5, 2021 · 0 comments
Open

Tree traversal functions #157

koraa opened this issue Feb 5, 2021 · 0 comments
Labels
enhancement New feature or request needs-api-design

Comments

@koraa
Copy link
Contributor

koraa commented Feb 5, 2021

We should provide functions for traversing trees make from containers that implement Get/Set

const treeGet = (seq, tree) => foldl(seq, tree, (c, k) => get(c, k));
const treeSet = (seq, tree, value) =>
const tryTreeGet = (seq, tree, default) => // Returns default if a node didn't exist
const tryTreeSet = (seq, tree, value) => // Won't throw an exception if an intermediate node didn't exist
const treeCreateNodes = (seq, tree) => // Will create intermediate nodes (default values in sequence which is of the form [[key, defaultValue],...])
@koraa koraa added the enhancement New feature or request label Feb 5, 2021
@koraa koraa changed the title getdefault, get/set by path… Tree traversal functions Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-api-design
Projects
None yet
Development

No branches or pull requests

1 participant