Given a parent JsValue, tries to extract the child value.
Given a parent JsValue, tries to extract the child value.
Right(value) if the lens read succeeds. Left(error) if the lens read fails.
Applies function f on the child of the parent denoted by this UpdateLens
and returns a Right of the parent with the child element updated.
Applies function f on the child of the parent denoted by this UpdateLens
and returns a Right of the parent with the child element updated.
The value passed to f may be Left(e) if the child could not be found
in which case particular operations may still succeed. Function f may return
Left(error) in case the operation fails.
updated returns Left(error) if the update operation or any of any intermediate
lens fails.
A shortcut for the combine lens which combines two lenses.
Given a parent JsValue extracts and converts a JsValue into a value of
type T or throws an exception.
Lifts a predicate for a converted value for this lens up to the parent level.
Given a parent JsValue extracts and tries to convert the JsValue into
a value of type T
This implements most of the methods of
Lens. Implementors of a new type of lens must implementretrfor the read side of the lens andupdatedfor the update side of the lens.