-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
lens-compose should compose lenses in the same order as compose (it does currently, but it should be documented in tests that this order is preferred). This is to preserve the general assumption that lenses work like functions, but with the added "inverting" behavior for bidirectional programming. This assumption means the following should all be true:
- When only using
lens-view, lenses should operate like the getter functions they mimic. Thus,(lens-view (lens-compose l ...) target)should be equivalent to((compose (lens-view l _) ...) target). - Applicable lenses behave like getters literally, so
((lens-compose l ...) target)should be equivalent to((compose l ...) target)when using applicable lenses. lens-thrushshould invert direction just likethrushinverts function composition direction.
This issue is more to document why I made this ordering decision, as I recently noticed that Ramda's lensCompose uses the "wrong order".
Metadata
Metadata
Assignees
Labels
No labels