concrete-optics.traversal.structures

Traversal constructors an examples.

ix

(ix k)

This tarversal focuses on a field which may not be present. So the to-list function on an ix tarversal produces a vector with at most one element.

mk-traversal

(mk-traversal traverse)

Constructs a traversal from a traverse function. A traverse function expects an applicative and a function which takes a value and produces another value in the given applicative. The result returned by the traverse function again should be in the applicative.

tree-traversal

(tree-traversal node? disassemble reassemble)

Standard tree tarversal. The function disassemble should turn the tree into a list of nodes and subrees and reassemble should be able to put it back preserving the shape of th tree without touching the contents of the tree

vector-traversal

This is the standard traversal structure on vectors.