Fork me on GitHub
#specter
<
2018-01-11
>
phreed22:01:27

Is there a way to do mutual navigation? A use would be to update one structure with data from another.

nathanmarz23:01:37

@phreed do you have an example of a transformation of this sort?

phreed23:01:52

The general idea is seen in the 'reduce' macro where one navigation is done over the collection and the reducing function navigates over and updates the accumulator. If the accumulator were implemented as a zipper the position would persist. In the large, assume I have a database for which I have just received a message on a relevant topic with which I want to update my database. I will navigate the message and use the information found there to navigate the database. There would be some collect object shared between the two navigators. The database could be a graph.

nathanmarz23:01:57

@phreed you can use collect and collect-one to collect additional information about the data structure during navigation

nathanmarz23:01:17

either as additional arguments to the transform function or returned with the navigated values in select