python-lenses
python-lenses copied to clipboard
A python lens library for manipulating deeply nested immutable structures
The following two snippets produce different results: The following appears to me to be correct: ```py lens.Each().Parts().F(sum).get()([1,2,3]) # returns 6 ``` Whereas I think this is a bug: ```py (lens.Each()...
compare with [glom](https://glom.readthedocs.io/)
Hey, it would be useful to have a version of lens.Tuple that accepts two getters. (Implementation in pseudo-code:) Could make a class `GetterTuple(getters)` which has type `Getter` and whose getter...
Python's nonlocal state side effects give every setter traversal powers. You should unify them or have a utility to convert them. I say this because using `re.sub` (which allows a...
https://python-lenses.readthedocs.io/en/latest/tutorial/optics.html#setters > This method allows you to create a setter that can set at two different places at once.This method allows you to create a setter that can set at...
The call stacks end up super deep and the order of operations strange. Have you considered a refactor where `lens.....get()` is compiled into a function block where `.F(getter)` corresponds to...