partial.lenses
Advanced tools
Changelog
13.1.0
Obsoleted L.iftes
and added L.ifElse
and L.cond
as the replacements for
it. The motivation for the change is that formatting tools such as
Prettier cannot produce readable layouts for combinators
that use such non-trivial argument patterns. In cases where there is just a
single predicate, use L.ifElse
:
-L.iftes(predicate, consequent, alternative)
+L.ifElse(predicate, consequent, alternative)
In cases where there are multiple predicates, use L.cond
:
-L.iftes(predicate1, consequent1,
- predicate2, consequent2,
- alternative)
+L.cond([predicate1, consequent1],
+ [predicate2, consequent2],
+ [alternative])
Changelog
13.0.0
As discussed in issue
#131, optics working on
arrays, objects, and strings, no longer remove empty values by default. It
appears that by default removal, on average, makes optics compositions more
complex. In most cases this change means that uses of L.define
or L.required
with an empty value {}
, []
, or ""
, can simply be removed. L.define
and
L.required
now give a warning in case they are used with an empty value and a
matching empty value passes through them redundantly. In cases where removal of
empty values is desired, one can e.g. compose with L.defaults
. In cases where
some default value is needed, one can e.g. compose with L.valueOr
.
Removed previously obsoleted L.findHint
.