4 ms·
It is useful to be able to speak of Lens and Traversal to distinguish intent. All lenses are Traversals, but not vice versa. What you have here is of course the
by involans 8y ago
It is useful to be able to speak of Lens and Traversal to distinguish intent. All lenses are Traversals, but not vice versa. What you have here is of course the Traversal system without the other optics.
- Tarean 8y agoIt's also useful for stuff like 'get' to look differently. user ^. id txt ^? _JSON . key "foo" txt ^?! _JSON . key "foo" First one gives exactly one result. The second one is the equivalent of returning null on failure. The third one throws an exception on failure. And because of the somewhat peculiar implementation of van laarhoven lenses we get subtyping so it doesn't get in the way.