monocle

Fold

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

S

the source of a Fold

A

the target of a Fold

Self Type
Fold[S, A]
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Fold
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Fold()

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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def ^<->[B, C, D](other: PIso[A, B, C, D]): Fold[S, C]

    alias to composeIso

    alias to composeIso

    Annotations
    @inline()
  7. final def ^<-?[B, C, D](other: PPrism[A, B, C, D]): Fold[S, C]

    alias to composePrism

    alias to composePrism

    Annotations
    @inline()
  8. final def ^|->[B, C, D](other: PLens[A, B, C, D]): Fold[S, C]

    alias to composeLens

    alias to composeLens

    Annotations
    @inline()
  9. final def ^|->>[B, C, D](other: PTraversal[A, B, C, D]): Fold[S, C]

    alias to composeTraversal

    alias to composeTraversal

    Annotations
    @inline()
  10. final def ^|-?[B, C, D](other: POptional[A, B, C, D]): Fold[S, C]

    alias to composeOptional

    alias to composeOptional

    Annotations
    @inline()
  11. final def all(p: (A) ⇒ Boolean)(s: S): Boolean

    check if all targets satisfy the predicate

    check if all targets satisfy the predicate

    Annotations
    @inline()
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. final def composeFold[B](other: Fold[A, B]): Fold[S, B]

    compose a Fold with a Fold

    compose a Fold with a Fold

    Annotations
    @inline()
  15. final def composeGetter[C](other: Getter[A, C]): Fold[S, C]

    compose a Fold with a Getter

    compose a Fold with a Getter

    Annotations
    @inline()
  16. final def composeIso[B, C, D](other: PIso[A, B, C, D]): Fold[S, C]

    compose a Fold with a PIso

    compose a Fold with a PIso

    Annotations
    @inline()
  17. final def composeLens[B, C, D](other: PLens[A, B, C, D]): Fold[S, C]

    compose a Fold with a PLens

    compose a Fold with a PLens

    Annotations
    @inline()
  18. final def composeOptional[B, C, D](other: POptional[A, B, C, D]): Fold[S, C]

    compose a Fold with a POptional

    compose a Fold with a POptional

    Annotations
    @inline()
  19. final def composePrism[B, C, D](other: PPrism[A, B, C, D]): Fold[S, C]

    compose a Fold with a PPrism

    compose a Fold with a PPrism

    Annotations
    @inline()
  20. 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()
  21. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  23. final def exist(p: (A) ⇒ Boolean)(s: S): Boolean

    check if at least one target satisfies the predicate

    check if at least one target satisfies the predicate

    Annotations
    @inline()
  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def find(p: (A) ⇒ Boolean)(s: S): Option[A]

    find the first target of a Fold matching the predicate

    find the first target of a Fold matching the predicate

    Annotations
    @inline()
  26. 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()
  27. final def getAll(s: S): List[A]

    get all the targets of a Fold TODO: Shall it return a Stream as there might be an infinite number of targets?

    get all the targets of a Fold TODO: Shall it return a Stream as there might be an infinite number of targets?

    Annotations
    @inline()
  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. final def headOption(s: S): Option[A]

    get the first target of a Fold

    get the first target of a Fold

    Annotations
    @inline()
  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  35. final def sum[S1](other: Fold[S1, A]): Fold[\/[S, S1], A]

    join two Fold with the same target

    join two Fold with the same target

    Annotations
    @inline()
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    AnyRef → Any
  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def headMaybe(s: S): Maybe[A]

    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 1.1.0) use headOption

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped