lens icon indicating copy to clipboard operation
lens copied to clipboard

Modulo lens

Open AlexKnauth opened this issue 8 years ago • 3 comments

Something like:

> (lens-view (modulo-lens 10) 16)
6
> (lens-set (modulo-lens 10) 16 9)
19

AlexKnauth avatar Sep 15 '16 23:09 AlexKnauth

Ou, that's neat

jackfirth avatar Sep 16 '16 06:09 jackfirth

Seems like something that should go in a library of math-specific lenses

jackfirth avatar Sep 16 '16 06:09 jackfirth

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)

AlexKnauth avatar Sep 16 '16 14:09 AlexKnauth