Companion

object Companion

Functions

Link copied to clipboard
fun <S> codiagonal(): Optional<Either<S, S>, S>

POptional that takes either S or S and strips the choice of S.

Link copied to clipboard
fun <S> id(): PIso<S, S, S, S>
Link copied to clipboard
operator fun <S, T, A, B> invoke(getOrModify: (S) -> Either<T, A>, set: (S, B) -> T): POptional<S, T, A, B>

Invoke operator overload to create a POptional of type S with focus A. Can also be used to construct Optional

Link copied to clipboard
fun <A> listHead(): Optional<List<A>, A>

Optional to safely operate on the head of a list

Link copied to clipboard
fun <A> listTail(): Optional<List<A>, List<A>>

Optional to safely operate on the tail of a list

Link copied to clipboard
fun <A> nullable(): Optional<A?, A>
Link copied to clipboard
fun <A, B> void(): Optional<A, B>

POptional that never sees its focus