trait 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]
- Source
- Fold.scala
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Fold
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
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
- def all(p: (A) => Boolean): (S) => Boolean
check if all targets satisfy the predicate
- def andThen[B](other: Fold[A, B]): Fold[S, B]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exist(p: (A) => Boolean): (S) => Boolean
check if at least one target satisfies the predicate
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def find(p: (A) => Boolean): (S) => Option[A]
find the first target matching the predicate
- def fold(s: S)(implicit ev: Monoid[A]): A
combine all targets using a target's Monoid
- def getAll(s: S): List[A]
get all the targets of a Fold
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def headOption(s: S): Option[A]
get the first target
- def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]
- def isEmpty(s: S): Boolean
check if there is no target
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lastOption(s: S): Option[A]
get the last target
- def length(s: S): Int
calculate the number of targets
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty(s: S): Boolean
check if there is at least one target
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def some[A1](implicit ev1: =:=[A, Option[A1]]): Fold[S, A1]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def to[C](f: (A) => C): Fold[S, C]
Compose with a function lifted into a Getter
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()