5 ms·
Lenses are a kind of Traversal in the same way a square is a kind of rectangle. Everywhere you use a Traversal you can use a lens. A lens just happens to guara
by dwohnitmok 8y ago
Lenses are a kind of Traversal in the same way a square is a kind of rectangle. Everywhere you use a Traversal you can use a lens.
A lens just happens to guarantee you can always get the element you're looking for and so more restrictive functions that cannot tolerate failure to find an element must use lenses.
The more fundamental divide is between lenses and prisms (which are also a kind of Traversal).