lens
lens copied to clipboard
Modulo lens
Something like:
> (lens-view (modulo-lens 10) 16)
6
> (lens-set (modulo-lens 10) 16 9)
19
Ou, that's neat
Seems like something that should go in a library of math-specific lenses
I was thinking something like lens/data/number
, in the lens-data
package. (Edit: that would be where this would go if/when it's moved out of unstable)