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

consider adding some language sugar to navigate and transform data structures #119

Open
dhh1128 opened this issue Sep 29, 2015 · 0 comments

Comments

@dhh1128
Copy link
Owner

dhh1128 commented Sep 29, 2015

Lots of code needs to walk data structures and do a transformation on them.

Python has the "map" function that applies a transform to every element in a collection.

The Spectre library in Clojure builds on a similar concept, but it allows you to define a "path" through one or more layers of data structure to identify an element, and then provide a transforming function to operate on that path. You can pass in different paths to the same general algorithm, making it possible to walk a binary tree, a list, a map, and other structures and do the same thing on end nodes, varying only the path through the data structures.

See http://nathanmarz.com/blog/functional-navigational-programming-in-clojurescript-with-sp.html

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

No branches or pull requests

1 participant