//arrow-optics/arrow.optics/PTraversal

PTraversal

common 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.

Traversal is a generalisation of kotlin.collections.map and can be seen as a representation of modify. all methods are written in terms of modify

Parameters

common

   
S the source of a PTraversal
T the modified source of a PTraversal
A the target of a PTraversal
B the modified target of a PTraversal

Types

Name Summary
Companion common object Companion

Functions

Name Summary
choice common open infix fun <U, V> choice(other: PSetter<U, V, A, B>): PSetter<Either<S, U>, Either<T, V>, A, B>
Join two PSetter with the same target
common open fun <U, V> choice(other: PTraversal<U, V, A, B>): PTraversal<Either<S, U>, Either<T, V>, A, B>
compose common open infix fun <C, D> compose(other: PSetter<in A, out B, out C, in D>): PSetter<S, T, C, D>
Compose a PSetter with a PSetter
common open infix fun <C, D> compose(other: PTraversal<in A, out B, out C, in D>): PTraversal<S, T, C, D>
Compose a PTraversal with a PTraversal
lift common open fun lift(map: (A) -> B): (S) -> T
Lift a function map: (A) -> B to the context of S: (S) -> T`
modify common abstract override fun modify(source: S, map: (A) -> B): T
Modify polymorphically the focus of a PSetter with a function map.
plus common open operator fun <C, D> plus(other: PSetter<in A, out B, out C, in D>): PSetter<S, T, C, D>
open operator fun <C, D> plus(other: PTraversal<in A, out B, out C, in D>): PTraversal<S, T, C, D>
set common open fun set(source: S, focus: B): T
Set polymorphically the focus of a PSetter with a value b.

Properties

Name Summary
every common open val <U, V> PLens<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a Lens for a structure S to see all its foci A
every common open val <U, V> PIso<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a Iso for a structure S to see all its foci A
every common open val <U, V> PPrism<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a Prism for a structure S to see all its foci A
every common open val <U, V> POptional<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a Optional for a structure S to see all its foci A
every common open val <U, V> PSetter<U, V, S, T>.every: PSetter<U, V, A, B>
DSL to compose Traversal with a Setter for a structure S to see all its foci A
every common open val <U, V> PTraversal<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a Traversal for a structure S to see all its foci A
every common open val <U, V> PEvery<U, V, S, T>.every: PTraversal<U, V, A, B>
DSL to compose Traversal with a PEvery for a structure S to see all its foci A

Inheritors

Name
PEvery
PIso
PLens
POptional
PPrism

Do you like Arrow?

Arrow Org
<