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

S

the source of a Fold

A

the target of a Fold

Self Type
Fold[S, A]
Source
Fold.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fold
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def foldMap[M](f: (A) => M)(s: S)(implicit arg0: Monoid[M]): M

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

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def all(p: (A) => Boolean): (S) => Boolean

    check if all targets satisfy the predicate

  5. def andThen[B](other: Fold[A, B]): Fold[S, B]

    compose a Fold with another Fold

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def exist(p: (A) => Boolean): (S) => Boolean

    check if at least one target satisfies the predicate

  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. def find(p: (A) => Boolean): (S) => Option[A]

    find the first target matching the predicate

  13. def fold(s: S)(implicit ev: Monoid[A]): A

    combine all targets using a target's Monoid

  14. def getAll(s: S): List[A]

    get all the targets of a Fold

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def headOption(s: S): Option[A]

    get the first target

  18. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]
  19. def isEmpty(s: S): Boolean

    check if there is no target

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def lastOption(s: S): Option[A]

    get the last target

  22. def length(s: S): Int

    calculate the number of targets

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def nonEmpty(s: S): Boolean

    check if there is at least one target

  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. def some[A1](implicit ev1: =:=[A, Option[A1]]): Fold[S, A1]
  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. def to[C](f: (A) => C): Fold[S, C]

    Compose with a function lifted into a Getter

  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def left[C]: Fold[Either[S, C], Either[A, C]]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  2. def right[C]: Fold[Either[C, S], Either[C, A]]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped