Getter

monocle.Getter
See theGetter companion object
trait Getter[S, A] extends Fold[S, A]

A Getter can be seen as a glorified get method between a type S and a type A.

A Getter is also a valid Fold

Attributes

A

the target of a Getter

S

the source of a Getter

Companion:
object
Source:
Getter.scala
Graph
Supertypes
trait Fold[S, A]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
trait PLens[S, T, A, B]
trait PIso[S, T, A, B]
Self type
Getter[S, A]

Members list

Concise view

Value members

Abstract methods

def get(s: S): A

get the target of a Getter

get the target of a Getter

Attributes

Source:
Getter.scala

Concrete methods

def andThen[B](other: Getter[A, B]): Getter[S, B]

compose a Getter with a Getter

compose a Getter with a Getter

Attributes

Source:
Getter.scala
def asFold: Fold[S, A]

view a Getter with a Fold

view a Getter with a Fold

Attributes

Source:
Getter.scala
def at[I, A1](i: I)(implicit evAt: At[A, I, A1]): Getter[S, A1]
Implicitly added by getterSyntax

Attributes

Source:
Getter.scala
def choice[S1](other: Getter[S1, A]): Getter[Either[S, S1], A]

join two Getter with the same target

join two Getter with the same target

Attributes

Source:
Getter.scala
def each[C](implicit evEach: Each[A, C]): Fold[S, C]
Implicitly added by getterSyntax

Attributes

Source:
Getter.scala
override def exist(p: A => Boolean): S => Boolean

check if the target satisfies the predicate

check if the target satisfies the predicate

Attributes

Definition Classes
Source:
Getter.scala
def filter(predicate: A => Boolean): Fold[S, A]
Implicitly added by getterSyntax

Select all the elements which satisfies the predicate. This combinator can break the fusion property see Optional.filter for more details.

Select all the elements which satisfies the predicate. This combinator can break the fusion property see Optional.filter for more details.

Attributes

Source:
Getter.scala
def filterIndex[I, A1](predicate: I => Boolean)(implicit ev: FilterIndex[A, I, A1]): Fold[S, A1]
Implicitly added by getterSyntax

Attributes

Source:
Getter.scala
override def find(p: A => Boolean): S => Option[A]

find if the target satisfies the predicate

find if the target satisfies the predicate

Attributes

Definition Classes
Source:
Getter.scala
def foldMap[M : Monoid](f: A => M)(s: S): M

map each target to a Monoid and combine the results underlying representation of Fold, all Fold methods are defined in terms of foldMap

map each target to a Monoid and combine the results underlying representation of Fold, all Fold methods are defined in terms of foldMap

Attributes

Source:
Getter.scala
override def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]

Attributes

Definition Classes
Source:
Getter.scala
override def some[A1](implicit ev1: A =:= Option[A1]): Fold[S, A1]

Attributes

Definition Classes
Source:
Getter.scala
def split[S1, A1](other: Getter[S1, A1]): Getter[(S, S1), (A, A1)]

pair two disjoint Getter

pair two disjoint Getter

Attributes

Source:
Getter.scala
override def to[C](f: A => C): Getter[S, C]

Compose with a function lifted into a Getter

Compose with a function lifted into a Getter

Attributes

Definition Classes
Source:
Getter.scala
def withDefault[A1](defaultValue: A1)(implicit evOpt: A =:= Option[A1]): Getter[S, A1]
Implicitly added by getterSyntax

Attributes

Source:
Getter.scala
def zip[A1](other: Getter[S, A1]): Getter[S, (A, A1)]

Attributes

Source:
Getter.scala

Deprecated methods

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

alias to composeIso

alias to composeIso

Attributes

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

alias to composePrism

alias to composePrism

Attributes

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

alias to composeLens

alias to composeLens

Attributes

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

alias to composeTraversal

alias to composeTraversal

Attributes

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

alias to composeOptional

alias to composeOptional

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def composeFold[C](other: Fold[A, C]): Fold[S, C]
Implicitly added by getterSyntax

compose a Fold with a Fold

compose a Fold with a Fold

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def composeGetter[C](other: Getter[A, C]): Getter[S, C]
Implicitly added by getterSyntax

compose a Fold with a Getter

compose a Fold with a Getter

Attributes

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

compose a Fold with a PIso

compose a Fold with a PIso

Attributes

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

compose a Fold with a PLens

compose a Fold with a PLens

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def composeOptional[B, C, D](other: POptional[A, B, C, D]): Fold[S, C]
Implicitly added by getterSyntax

compose a Fold with a POptional

compose a Fold with a POptional

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def composePrism[B, C, D](other: PPrism[A, B, C, D]): Fold[S, C]
Implicitly added by getterSyntax

compose a Fold with a PPrism

compose a Fold with a PPrism

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def composeTraversal[B, C, D](other: PTraversal[A, B, C, D]): Fold[S, C]
Implicitly added by getterSyntax

compose a Fold with a PTraversal

compose a Fold with a PTraversal

Attributes

Deprecated
[Since version 3.0.0-M1]
Source:
Getter.scala
def first[B]: Getter[(S, B), (A, B)]

Attributes

Deprecated
[Since version 3.0.0-M4]
Source:
Getter.scala
def index[I, A1](i: I, evIndex: Index[A, I, A1]): Fold[S, A1]
Implicitly added by getterSyntax

Attributes

Deprecated
true
Source:
Getter.scala
override def left[C]: Getter[Either[S, C], Either[A, C]]

Attributes

Deprecated
[Since version 3.0.0-M4]
Definition Classes
Source:
Getter.scala
override def right[C]: Getter[Either[C, S], Either[C, A]]

Attributes

Deprecated
[Since version 3.0.0-M4]
Definition Classes
Source:
Getter.scala
def second[B]: Getter[(B, S), (B, A)]

Attributes

Deprecated
[Since version 3.0.0-M4]
Source:
Getter.scala

Inherited methods

def all(p: A => Boolean): S => Boolean

check if all targets satisfy the predicate

check if all targets satisfy the predicate

Attributes

Inherited from:
Fold
Source:
Fold.scala
def andThen[B](other: Fold[A, B]): Fold[S, B]

compose a Fold with another Fold

compose a Fold with another Fold

Attributes

Inherited from:
Fold
Source:
Fold.scala
def fold(s: S)(implicit ev: Monoid[A]): A

combine all targets using a target's Monoid

combine all targets using a target's Monoid

Attributes

Inherited from:
Fold
Source:
Fold.scala
def getAll(s: S): List[A]

get all the targets of a Fold

get all the targets of a Fold

Attributes

Inherited from:
Fold
Source:
Fold.scala
def headOption(s: S): Option[A]

get the first target

get the first target

Attributes

Inherited from:
Fold
Source:
Fold.scala
def isEmpty(s: S): Boolean

check if there is no target

check if there is no target

Attributes

Inherited from:
Fold
Source:
Fold.scala
def lastOption(s: S): Option[A]

get the last target

get the last target

Attributes

Inherited from:
Fold
Source:
Fold.scala
def length(s: S): Int

calculate the number of targets

calculate the number of targets

Attributes

Inherited from:
Fold
Source:
Fold.scala
def nonEmpty(s: S): Boolean

check if there is at least one target

check if there is at least one target

Attributes

Inherited from:
Fold
Source:
Fold.scala
Implicitly added by getterSyntax

Attributes

Inherited from:
Product
Implicitly added by getterSyntax

Attributes

Inherited from:
Product