//arrow-optics/arrow.optics/PSetter

PSetter

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

A (polymorphic) PSetter is useful when setting or modifying a value for a constructed type i.e. PSetter, List, Int, String>

A PSetter is a generalisation of a arrow.Functor. Functor::map (fa: Kind, f: (A) -> B): Kind PSetter::modify(s: S, f: (A) -> B): T

Parameters

common

   
S the source of a PSetter
T the modified source of a PSetter
A the focus of a PSetter
B the modified focus of a PSetter

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
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
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 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>
set common open fun set(source: S, focus: B): T
Set polymorphically the focus of a PSetter with a value b.

Inheritors

Name
PEvery
PIso
PLens
POptional
PPrism
PTraversal

Do you like Arrow?

Arrow Org
<