PSetter

monocle.PSetter
See thePSetter companion object
trait PSetter[S, T, A, B] extends Serializable

A PSetter is a generalisation of Functor map:

  • map: (A => B) => F[A] => F[B]
  • modify: (A => B) => S => T

PSetter stands for Polymorphic Setter as it replace and modify methods change a type A to B and S to T. Setter is a type alias for PSetter restricted to monomorphic updates:

type Setter[S, A] = PSetter[S, S, A, A]

PTraversal, POptional, PPrism, PLens and PIso are valid PSetter

Attributes

A

the target of a PSetter

B

the modified target of a PSetter

S

the source of a PSetter

T

the modified source of a PSetter

See also:
Companion:
object
Source:
Setter.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
trait PTraversal[S, T, A, B]
trait POptional[S, T, A, B]
trait PLens[S, T, A, B]
trait PIso[S, T, A, B]
trait PPrism[S, T, A, B]
Self type
PSetter[S, T, A, B]

Members list

Concise view

Value members

Abstract methods

def modify(f: A => B): S => T

modify polymorphically the target of a PSetter with a function

modify polymorphically the target of a PSetter with a function

Attributes

Source:
Setter.scala
def replace(b: B): S => T

replace polymorphically the target of a PSetter with a value

replace polymorphically the target of a PSetter with a value

Attributes

Source:
Setter.scala

Concrete methods

def andThen[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]

compose a PSetter with another PSetter

compose a PSetter with another PSetter

Attributes

Source:
Setter.scala
def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1], evMonoS: S =:= T, evMonoA: A =:= B): Setter[S, A1]

Attributes

Source:
Setter.scala
def some[A1, B1](implicit ev1: A =:= Option[A1], ev2: B =:= Option[B1]): PSetter[S, T, A1, B1]

Attributes

Source:
Setter.scala

Deprecated methods

def ^<->[C, D](other: PIso[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

alias to composeIso

alias to composeIso

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def ^<-?[C, D](other: PPrism[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

alias to composePrism

alias to composePrism

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def ^|->[C, D](other: PLens[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

alias to composeLens

alias to composeLens

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def ^|->>[C, D](other: PTraversal[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

alias to composeTraversal

alias to composeTraversal

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def ^|-?[C, D](other: POptional[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

alias to composeOptional

alias to composeOptional

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composeIso[C, D](other: PIso[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a PIso

compose a PSetter with a PIso

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composeLens[C, D](other: PLens[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a PLens

compose a PSetter with a PLens

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composeOptional[C, D](other: POptional[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a POptional

compose a PSetter with a POptional

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composePrism[C, D](other: PPrism[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a PPrism

compose a PSetter with a PPrism

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composeSetter[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a PSetter

compose a PSetter with a PSetter

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def composeTraversal[C, D](other: PTraversal[A, B, C, D]): PSetter[S, T, C, D]
Implicitly added by pSetterSyntax

compose a PSetter with a PTraversal

compose a PSetter with a PTraversal

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala
def set(b: B): S => T

alias to replace

alias to replace

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Setter.scala

Inherited methods

Implicitly added by pSetterSyntax

Attributes

Inherited from:
Product
Implicitly added by pSetterSyntax

Attributes

Inherited from:
Product