On this page:
Glass:   Composable Optics
8.12

Glass: Composable Optics🔗ℹ

 (require glass) package: glass

This is an experimental library for optics. An optic is an object for viewing one form of data, called the subject, in some other form, called a focus. Optics are bidirectional: in addition to viewing the focus, optics allow changing the focus to get a new, updated subject. There are several different kinds of optics, each of which expresses a different relationship between subject and focus:

I’m working on this library for fun as a hypothetical successor to the lens library. I might put more work into it, or I might not. Absolutely no promise of backwards compatibility whatsoever. Caveat emptor.