//arrow-optics/arrow.optics

Package arrow.optics

Types

Name Summary
Every common typealias Every<S, A> = PEvery<S, S, A, A>
Fold common interface Fold<S, A>
A Fold is an optic that allows to focus into structure and get multiple results.
Getter common fun fun interface Getter<S, A> : Fold<S, A>
A Getter is an optic that allows to see into a structure and getting a focus.
Iso common typealias Iso<S, A> = PIso<S, S, A, A>
Iso is a type alias for PIso which fixes the type arguments and restricts the PIso to monomorphic updates.
Lens common typealias Lens<S, A> = PLens<S, S, A, A>
Lens is a type alias for PLens which fixes the type arguments and restricts the PLens to monomorphic updates.
Optional common typealias Optional<S, A> = POptional<S, S, A, A>
Optional is a type alias for POptional which fixes the type arguments and restricts the POptional to monomorphic updates.
PEvery common interface PEvery<S, T, A, B> : PTraversal<S, T, A, B> , Fold<S, A> , PSetter<S, T, A, B>
Composition of Fold and Traversal It combines their powers
PIso common interface PIso<S, T, A, B> : PPrism<S, T, A, B> , PLens<S, T, A, B> , Getter<S, A> , POptional<S, T, A, B> , PSetter<S, T, A, B> , Fold<S, A> , PTraversal<S, T, A, B> , PEvery<S, T, A, B>
An Iso is a loss less invertible optic that defines an isomorphism between a type S and A i.e.
PLens common interface PLens<S, T, A, B> : Getter<S, A> , POptional<S, T, A, B> , PSetter<S, T, A, B> , Fold<S, A> , PTraversal<S, T, A, B> , PEvery<S, T, A, B>
A Lens (or Functional Reference) is an optic that can focus into a structure for getting, setting or modifying the focus (target).
POptional common interface POptional<S, T, A, B> : PSetter<S, T, A, B> , Fold<S, A> , PTraversal<S, T, A, B> , PEvery<S, T, A, B>
Optional is an optic that allows to focus into a structure and querying or copy’ing an optional focus.
PPrism common interface PPrism<S, T, A, B> : POptional<S, T, A, B> , PSetter<S, T, A, B> , Fold<S, A> , PTraversal<S, T, A, B> , PEvery<S, T, A, B>
A Prism is a loss less invertible optic that can look into a structure and optionally find its focus.
Prism common typealias Prism<S, A> = PPrism<S, S, A, A>
Prism is a type alias for PPrism which fixes the type arguments and restricts the PPrism to monomorphic updates.
PSetter common fun fun interface PSetter<S, T, A, B>
A Setter is an optic that allows to see into a structure and set or modify its focus.
PTraversal common fun fun interface PTraversal<S, T, A, B> : PSetter<S, T, A, B>
A Traversal is an optic that allows to see into a structure with 0 to N foci.
Setter common typealias Setter<S, A> = PSetter<S, S, A, A>
Setter is a type alias for PSetter which fixes the type arguments and restricts the PSetter to monomorphic updates.
Traversal common typealias Traversal<S, A> = PTraversal<S, S, A, A>
Traversal is a type alias for PTraversal which fixes the type arguments and restricts the PTraversal to monomorphic updates.

Functions

Name Summary
cons common infix fun <A> A.cons(tail: List<A>): List<A>
get common operator fun <A, T> PLens<T, T, List<A>, List<A».get(i: Int): POptional<T, T, A, A>
Optional common fun <S, A> Optional(getOption: (S) -> Option<A>, set: (S, A) -> S): Optional<S, A>
Prism common fun <S, A> Prism(getOption: (S) -> Option<A>, reverseGet: (A) -> S): Prism<S, A>
Invoke operator overload to create a PPrism of type S with a focus A where A is a subtype of S Can also be used to construct Prism
snoc common infix fun <A> List<A>.snoc(last: A): List<A>
uncons common fun <A> List<A>.uncons(): Pair<A, List<A»?
unsnoc common fun <A> List<A>.unsnoc(): Pair<List<A>, A>?

Do you like Arrow?

Arrow Org
<