Package fj.data.optic

Class POptional<S,T,A,B>

java.lang.Object
fj.data.optic.POptional<S,T,A,B>
Type Parameters:
S - the source of a POptional
T - the modified source of a POptional
A - the target of a POptional
B - the modified target of a POptional
Direct Known Subclasses:
Optional

public abstract class POptional<S,T,A,B> extends Object
A POptional can be seen as a pair of functions:
  • getOrModify: S => T \/ A
  • set : (B, S) => T

A POptional could also be defined as a weaker PLens and weaker PPrism

POptional stands for Polymorphic Optional as it set and modify methods change a type A to B and S to T. Optional is a POptional restricted to monomoprhic updates: type Optional[S, A] = POptional[S, S, A, A]

  • Constructor Details

    • POptional

      POptional()
  • Method Details