Class PPrism<S,T,A,B>

java.lang.Object
io.atlassian.fugue.optic.PPrism<S,T,A,B>
Type Parameters:
S - the source of a PPrism
T - the modified source of a PPrism
A - the target of a PPrism
B - the modified target of a PPrism
Direct Known Subclasses:
Prism

public abstract class PPrism<S,T,A,B> extends Object
A PPrism can be seen as a pair of functions: - `getOrModify: S => T \/ A` - `reverseGet : B => T`

A PPrism could also be defined as a weaker PIso where get can fail.

Typically a PPrism or Prism encodes the relation between a Sum or CoProduct type (e.g. sealed trait) and one of it is element.

PPrism stands for Polymorphic Prism as it set and modify methods change a type `A` to `B` and `S` to `T`. Prism is a PPrism where the type of target cannot be modified.

A PPrism is also a valid Fold, POptional, PTraversal and PSetter