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

Feature/groupoid #63

Closed
wants to merge 15 commits into from
Closed

Feature/groupoid #63

wants to merge 15 commits into from

Conversation

sadasant
Copy link
Contributor

@sadasant sadasant commented Mar 16, 2017

Studied a bit and found out that the foldWhile/flowReduce were an implementation of an automata, a finite state machine, but with non-deterministic data structures and an unbounded number of generators... which is generalized in Category Theory as the Groupoid Category. See https://en.wikipedia.org/wiki/Automata_theory#Connection_to_category_theory

This implementation satisfies exactly the same tests as flowReduce, but is completely stripped of lodash utilities for clarity.

The name is particularly tempting since is easy to pronounce, funny enough to remember, and technically precise 😱

Please review 😻

deepTransform
Transforms a recursive iterable by a given function. Works like deepMap but
allows you to stop transforming at any point of the tree. The traversing
happens depth first.

deepFind
Goes over every `{ key, value }` of a recursive iterable data structure (for
arrays being numeric key and the value at the key position), and uses a function to extract
elements at any point in the tree onto an array that is returned. If a third
argument, the limit, is provided, it will stop iterating as soon as the number
of found objects reaches that limit.

Why?
Because this will allow me to find the first two nested occurrences of a terms
object with a field property and to modify the first so that it has:
`collect_mode: 'breadth_first'`
More abstract universal
[foldWhile](#58),
for infinite reducers.
@sadasant sadasant self-assigned this Mar 16, 2017
@sadasant sadasant requested a review from daedalus28 March 16, 2017 05:12
@sadasant sadasant force-pushed the feature/groupoid branch 3 times, most recently from 3caff58 to 2944228 Compare March 16, 2017 16:01
@daedalus28
Copy link
Contributor

Just an update here - conversation on this has been happening on the PR/Issues for Ramda, lodash, and fantasy land (fantasyland/fantasy-land#232)

@sadasant
Copy link
Contributor Author

Closing this.

@sadasant sadasant closed this Jul 28, 2017
@sadasant sadasant deleted the feature/groupoid branch July 28, 2017 16:25
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

Successfully merging this pull request may close these issues.

2 participants