Companion

Functions

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>, reverseGet: (B) -> T): PPrism<S, T, A, B>

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

Link copied to clipboard
@JvmName(name = "eitherLeft")
fun <L, R> left(): Prism<Either<L, R>, L>

Prism to focus into an arrow.core.Either.Left

Link copied to clipboard

Prism to focus into an arrow.core.None

Link copied to clipboard
fun <A> only(a: A, eq: (constant: A, other: A) -> Boolean = { aa, b -> aa == b }): Prism<A, Unit>

A PPrism that checks for equality with a given value a

Link copied to clipboard
fun <L, R, E> pLeft(): PPrism<Either<L, R>, Either<E, R>, L, E>

Polymorphic PPrism to focus into an arrow.core.Either.Left

Link copied to clipboard
fun <L, R, B> pRight(): PPrism<Either<L, R>, Either<L, B>, R, B>

Polymorphic PPrism to focus into an arrow.core.Either.Right

Link copied to clipboard
fun <A, B> pSome(): PPrism<Option<A>, Option<B>, A, B>

PPrism to focus into an arrow.core.Some

Link copied to clipboard
@JvmName(name = "eitherRight")
fun <L, R> right(): Prism<Either<L, R>, R>
Link copied to clipboard
fun <A> some(): Prism<Option<A>, A>

Prism to focus into an arrow.core.Some