PPrism
A Prism is a loss less invertible optic that can look into a structure and optionally find its focus. Mostly used for finding a focus that is only present under certain conditions i.e. list head Prism
A (polymorphic) PPrism is useful when setting or modifying a value for a polymorphic sum type i.e. PPrism
A PPrism gathers the two concepts of pattern matching and constructor and thus can be seen as a pair of functions:
getOrModify: A -> Either<A, B>
meaning it returns the focus of a PPrism OR the original valuereverseGet : B -> A
meaning we can construct the source type of a PPrism from a focusB
Parameters
the source of a PPrism
the modified source of a PPrism
the focus of a PPrism
the modified focus of a PPrism
Inheritors
Properties
DSL to compose a Optional with focus Either with a Prism with a focus of Either.Left<L>
DSL to compose a Prism with focus Either with a Prism with a focus of Either.Left<L>
DSL to compose a Traversal with focus Either with a Prism with a focus of Either.Left<L>
DSL to compose a Optional with focus Either with a Prism with a focus of Either.Right<R>
DSL to compose a Prism with focus Either with a Prism with a focus of Either.Right<R>
DSL to compose a Traversal with focus Either with a Prism with a focus of Either.Right<R>
DSL to compose a Prism with focus arrow.core.Some with a Fold with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Optional with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Prism with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Setter with a focus of Option<S>
DSL to compose a Prism with focus arrow.core.Some with a Traversal with a focus of Option<S>
Functions
Join two Fold with the same target
Join two POptionalGetter with the same focus
Join two PSetter with the same target
Compose a POptionalGetter with a POptionalGetter
Compose a PTraversal with a PTraversal
Find the first element matching the predicate, if one exists.
Get the first target or null
Get the focus of an OptionalGetter or null
if the is not there
Check if there is at least one target
Get the last target or null
Set the focus of a POptional with a value.