Getter

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 can be seen as a glorified get method between a type S and a type A.

A Getter is also a valid Fold

Type Params
A

the target of a Getter

S

the source of a Getter

Companion
object
Source
Getter.scala
trait Fold[S, A]
trait Serializable
class Object
trait Matchable
class Any
trait PLens[S, T, A, B]
trait PIso[S, T, A, B]

Value members

Abstract methods

def get(s: S): A

get the target of a [Getter

get the target of a [Getter

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

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

view a Getter with a Fold

view a Getter with a Fold

Source
Getter.scala
def at[I, A1](i: I)(evAt: At[A, I, A1]): Getter[S, A1]
Implicitly added by getterSyntax
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

Source
Getter.scala
def each[C](evEach: Each[A, C]): Fold[S, C]
Implicitly added by getterSyntax
override def exist(p: A => Boolean): S => Boolean

check if the target satisfies the predicate

check if the target satisfies the predicate

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.

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

find if the target satisfies the predicate

find if the target satisfies the predicate

Definition Classes
Source
Getter.scala
def foldMap[M](f: A => M)(s: S)(`evidence$1`: Monoid[M]): M
def index[I, A1](i: I)(evIndex: Index[A, I, A1]): Fold[S, A1]
Implicitly added by getterSyntax
override def some[A1](ev1: A =:= Option[A1]): Fold[S, A1]
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

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

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

Deprecated methods

@deprecated("use andThen", since = "3.0.0-M1")
def ^<->[B, C, D](other: PIso[A, B, C, D]): Getter[S, C]
Implicitly added by getterSyntax

alias to composeIso

alias to composeIso

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

alias to composePrism

alias to composePrism

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

alias to composeLens

alias to composeLens

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

alias to composeTraversal

alias to composeTraversal

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

alias to composeOptional

alias to composeOptional

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("use andThen", since = "3.0.0-M1")
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

Deprecated
[Since version 3.0.0-M1]
Source
Getter.scala
@deprecated("no replacement", since = "3.0.0-M4")
def first[B]: Getter[(S, B), (A, B)]
Deprecated
[Since version 3.0.0-M4]
Source
Getter.scala
@deprecated("no replacement", since = "3.0.0-M4")
override def left[C]: Getter[Either[S, C], Either[A, C]]
Deprecated
[Since version 3.0.0-M4]
Definition Classes
Source
Getter.scala
@deprecated("no replacement", since = "3.0.0-M4")
override def right[C]: Getter[Either[C, S], Either[C, A]]
Deprecated
[Since version 3.0.0-M4]
Definition Classes
Source
Getter.scala
@deprecated("no replacement", since = "3.0.0-M4")
def second[B]: Getter[(B, S), (B, A)]
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

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

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

combine all targets using a target's Monoid

combine all targets using a target's Monoid

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

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

get the first target

get the first target

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

check if there is no target

check if there is no target

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

get the last target

get the last target

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

calculate the number of targets

calculate the number of targets

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

Inherited from
Fold
Source
Fold.scala
def productElementNames: Iterator[String]
Implicitly added by getterSyntax
Inherited from
Product
def productIterator: Iterator[Any]
Implicitly added by getterSyntax
Inherited from
Product