arrow-optics / arrow.optics / POptional / getOrModify

getOrModify

abstract fun getOrModify(source: S): Either<T, A>

Get the focus of a POptional or return the original value while allowing the type to change if it does not match

Do you like Arrow?

Arrow Org
<