A Lens Family, offering a purely functional means to access and retrieve
a field transitioning from type B1
to type B2
in a record simultaneously
transitioning from type A1
to type A2
. scalaz.Lens is a convenient
alias for when A1 =:= A2
, and B1 =:= B2
.
The term ''field'' should not be interpreted restrictively to mean a member of a class. For example, a lens
family can address membership of a Set
.
- Type Params
- A1
The initial type of the record
- A2
The final type of the record
- B1
The initial type of the field
- B2
The final type of the field
- See also
- Companion
- object
Type members
Classlikes
Value members
Abstract methods
Concrete methods
Modify the portion of the state viewed through the lens and return its new value.
Modify the portion of the state viewed through the lens and return its new value.
Modify the portion of the state viewed through the lens, but do not return its new value.
Modify the portion of the state viewed through the lens, but do not return its new value.
alias for product
alias for product
Sequence the monadic action of looking through the lens to occur before the state action f
.
Sequence the monadic action of looking through the lens to occur before the state action f
.
Set the portion of the state viewed through the lens and return its new value.
Set the portion of the state viewed through the lens and return its new value.
Modify the portion of the state viewed through the lens and return its old value. alias for modo
Modify the portion of the state viewed through the lens and return its old value. alias for modo
- Since
7.0.2
Set the portion of the state viewed through the lens and return its old value. alias for assigno
Set the portion of the state viewed through the lens and return its old value. alias for assigno
- Since
7.0.2
Map the function f
over the value under the lens, as a state action.
Map the function f
over the value under the lens, as a state action.
Bind the function f
over the value under the lens, as a state action.
Bind the function f
over the value under the lens, as a state action.
Set the portion of the state viewed through the lens and return its new value.
Set the portion of the state viewed through the lens and return its new value.
Set the portion of the state viewed through the lens and return its old value.
Set the portion of the state viewed through the lens and return its old value.
- Since
7.0.2
This lens has undefined behavior when accessing an element not present in the map!
This lens has undefined behavior when accessing an element not present in the map!
Setting the value of this lens will change whether or not it is present in the set
Setting the value of this lens will change whether or not it is present in the set
Bind the function f
over the value under the lens, as a state action.
Bind the function f
over the value under the lens, as a state action.
Contravariantly map a state action through a lens.
Contravariantly map a state action through a lens.
Contravariantly mapping the state of a state monad through a lens is a natural transformation
Contravariantly mapping the state of a state monad through a lens is a natural transformation
Map the function f
over the lens as a state action.
Map the function f
over the lens as a state action.
Allows both viewing and setting the value of a member of the map
Allows both viewing and setting the value of a member of the map
Modify the value viewed through the lens, returning a functor X
full of results.
Modify the value viewed through the lens, returning a functor X
full of results.
Modify the portion of the state viewed through the lens and return its old value.
Modify the portion of the state viewed through the lens and return its old value.
- Since
7.0.2
Modify the value viewed through the lens, returning a C
on the side.
Modify the value viewed through the lens, returning a C
on the side.
Modify the portion of the state viewed through the lens and return its new value.
Modify the portion of the state viewed through the lens and return its new value.
Modify the portion of the state viewed through the lens, but do not return its new value.
Modify the portion of the state viewed through the lens, but do not return its new value.
Two disjoint lenses can be paired
Two disjoint lenses can be paired
Two lenses that view a value of the same type can be joined
Two lenses that view a value of the same type can be joined