Lists & Sequences
each lens
Section titled “each lens”Apply lens to every list element. right list when all succeed; left list of per-element Either on any failure.
(bend.each bend.int).get [ 1 "x" 3 ]# left [ (right 1) (left "x") (right 3) ]Cardinality
Section titled “Cardinality”many lens
Section titled “many lens”Zero or more — always right. Wraps each.
some lens
Section titled “some lens”One or more required. left [] when empty.
atLeast n lens
Section titled “atLeast n lens”At least n elements required.
exactly n lens
Section titled “exactly n lens”Exactly n elements required.
Direct Access
Section titled “Direct Access”index n
Section titled “index n”Focus on element at index n. right when in bounds; left otherwise.