lens
lens copied to clipboard
A Racket package for creating and composing pure functional lenses
Given a structure id, it should be possible to construct an isomoprhism between struct instances of that type and vectors ``` racket > (struct position (x y)) > (lens-view (struct->vector-lens...
Should accept a base and return an isomoprhism lens ``` racket > (lens-view (positive-integer->digits-lens 10) 123) ; base 10 '(1 2 3) > (lens-view (positive-integer->digits-lens 2) 123) ; base 2...
Special case of list-slice-lens where step is 1. Probably more efficiently implemented in terms of take and drop lenses.
The lenses are all that's needed to actually use the struct. If a user was making a bidirectional programming language (like [Boomerang](http://www.seas.upenn.edu/~harmony/)), they'd want to only use the lenses. This...
Docs should mention what an isomorphism actually is, and how isomorphism lenses are different from normal lenses in that they don't "zoom in" to view a small piece, they view...