partial.lenses
Advanced tools
Changelog
2.0.0
Changed from using a single default export to named exports to support dead-code
elimination, aka tree shaking. A number of combinators were renamed in the
process and the default import is now an alias for compose
that may help to
keep notation concise.
Now using named exports and default that aliases compose
:
-import L from "partial.lenses"
+import P, * as L from "partial.lenses"
Module prefix no longer works as compose
:
-L(...)
+P(...) or L.compose(...)
default
is a keyword and had to be renamed:
-L.default
+L.defaults
delete
is a keyword and had to be renamed:
-L.delete
+L.remove
-L.deleteAll
+L.removeAll
Changelog
11.0.0
Switched the order of arguments to optics so that the first two arguments are now the same as for an ordinary "read-only" function:
- (C, xi2yC, x, i) => ...
+ (x, i, C, xi2yC) => ...
This way it is not necessary to distinguish between optics and read-only
functions in the get
operation. On V8 based JavaScript engines this gives a
significant performance improvement in some operations as taking the length
of
a function is very expensive in V8. This also means that the behavior of
composing optics and ordinary functions is different in the sense that more
arguments may be passed to an ordinary function. This change should only affect
a very small number of users who have written new optics directly against the
internal encoding. In such a case, you will need to switch the order of
arguments as shown in the above diff. Also, if you compose optics with ordinary
functions that may use more than two arguments, then you will need to limit
those functions two arguments.