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

S

the source of a PSetter

T

the modified source of a PSetter

A

the target of a PSetter

B

the modified target of a PSetter

Self Type
PSetter[S, T, A, B]
Source
Setter.scala
See also

monocle.law.SetterLaws

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PSetter
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

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

    modify polymorphically the target of a PSetter with a function

  2. abstract def replace(b: B): (S) => T

    replace polymorphically the target of a PSetter with a value

Concrete Value Members

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

    compose a PSetter with another PSetter

  2. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1], evMonoS: =:=[S, T], evMonoA: =:=[A, B]): Setter[S, A1]
  3. def some[A1, B1](implicit ev1: =:=[A, Option[A1]], ev2: =:=[B, Option[B1]]): PSetter[S, T, A1, B1]

Deprecated Value Members

  1. def set(b: B): (S) => T

    alias to replace

    alias to replace

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M1) use replace instead