Modifier and Type | Method and Description |
---|---|
static <L,R> Lens.Simple<Either<L,R>,Maybe<L>> |
_left()
Convenience static factory method for creating a lens over left values, wrapping them in a
Maybe . |
static <L,R> Lens.Simple<Either<L,R>,Maybe<R>> |
_right()
Convenience static factory method for creating a lens over right values, wrapping them in a
Maybe . |
public static <L,R> Lens.Simple<Either<L,R>,Maybe<R>> _right()
Maybe
. When
setting, a Maybe.nothing()
value means to leave the Either
unaltered, where as a
Maybe.just(A)
value replaces the either with a right over the Maybe
.
Note that this lens is NOT lawful, since "you get back what you put in" fails for Maybe.nothing()
.
L
- the left parameter typeR
- the right parameter typepublic static <L,R> Lens.Simple<Either<L,R>,Maybe<L>> _left()
Maybe
. When
setting, a Maybe.nothing()
value means to leave the Either
unaltered, where as a
Maybe.just(A)
value replaces the either with a left over the Maybe
.
Note that this lens is NOT lawful, since "you get back what you put in" fails for Maybe.nothing()
.
L
- the left parameter typeR
- the right parameter type