abstract class Fold[S, A] extends Serializable
A Fold can be seen as a Getter with many targets or a weaker PTraversal which cannot modify its target.
Fold is on the top of the Optic hierarchy which means that Getter, PTraversal, POptional, PLens, PPrism and PIso are valid Fold
- Self Type
- Fold[S, A]
- Alphabetic
- By Inheritance
- Fold
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Fold()
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
^<->[B, C, D](other: PIso[A, B, C, D]): Fold[S, C]
alias to composeIso
alias to composeIso
- Annotations
- @inline()
-
final
def
^<-?[B, C, D](other: PPrism[A, B, C, D]): Fold[S, C]
alias to composePrism
alias to composePrism
- Annotations
- @inline()
-
final
def
^|->[B, C, D](other: PLens[A, B, C, D]): Fold[S, C]
alias to composeLens
alias to composeLens
- Annotations
- @inline()
-
final
def
^|->>[B, C, D](other: PTraversal[A, B, C, D]): Fold[S, C]
alias to composeTraversal
alias to composeTraversal
- Annotations
- @inline()
-
final
def
^|-?[B, C, D](other: POptional[A, B, C, D]): Fold[S, C]
alias to composeOptional
alias to composeOptional
- Annotations
- @inline()
-
final
def
all(p: (A) ⇒ Boolean): (S) ⇒ Boolean
check if all targets satisfy the predicate
check if all targets satisfy the predicate
- Annotations
- @inline()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
choice[S1](other: Fold[S1, A]): Fold[Either[S, S1], A]
join two Fold with the same target
join two Fold with the same target
- Annotations
- @inline()
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- final def composeFold[B](other: Fold[A, B]): Fold[S, B]
- final def composeGetter[C](other: Getter[A, C]): Fold[S, C]
- final def composeIso[B, C, D](other: PIso[A, B, C, D]): Fold[S, C]
- final def composeLens[B, C, D](other: PLens[A, B, C, D]): Fold[S, C]
- final def composeOptional[B, C, D](other: POptional[A, B, C, D]): Fold[S, C]
- final def composePrism[B, C, D](other: PPrism[A, B, C, D]): Fold[S, C]
-
final
def
composeTraversal[B, C, D](other: PTraversal[A, B, C, D]): Fold[S, C]
compose a Fold with a PTraversal
compose a Fold with a PTraversal
- Annotations
- @inline()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
exist(p: (A) ⇒ Boolean): (S) ⇒ Boolean
check if at least one target satisfies the predicate
check if at least one target satisfies the predicate
- Annotations
- @inline()
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
find(p: (A) ⇒ Boolean): (S) ⇒ Option[A]
find the first target matching the predicate
find the first target matching the predicate
- Annotations
- @inline()
-
final
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
- Annotations
- @inline()
-
final
def
getAll(s: S): List[A]
get all the targets of a Fold
get all the targets of a Fold
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
headOption(s: S): Option[A]
get the first target
get the first target
- Annotations
- @inline()
-
final
def
isEmpty(s: S): Boolean
check if there is no target
check if there is no target
- Annotations
- @inline()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
lastOption(s: S): Option[A]
get the last target
get the last target
- Annotations
- @inline()
-
final
def
left[C]: Fold[Either[S, C], Either[A, C]]
- Annotations
- @inline()
-
final
def
length(s: S): Int
calculate the number of targets
calculate the number of targets
- Annotations
- @inline()
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
nonEmpty(s: S): Boolean
check if there is at least one target
check if there is at least one target
- Annotations
- @inline()
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
right[C]: Fold[Either[C, S], Either[C, A]]
- Annotations
- @inline()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()