Trait/Object

org.atnos.origami

Fold

Related Docs: object Fold | package origami

Permalink

trait Fold[M[_], A, B] extends AnyRef

A Fold is a "left fold" over a data structure with:

Those 3 methods use a monad for effects

Self Type
Fold[M, A, B]
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fold
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type S

    Permalink

Abstract Value Members

  1. abstract def end(s: S): M[B]

    Permalink
  2. abstract def fold: (S, A) ⇒ M[S]

    Permalink
  3. implicit abstract def monad: Monad[M]

    Permalink
  4. abstract def start: M[S]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def &&&[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }

    Permalink

    fanout = zip in the Arrow terminology

  4. def ***[V, W](f: Fold[M, V, W]): Fold[M, (A, V), (B, W)] { ... /* 2 definitions in type refinement */ }

    Permalink

    parallel composition

  5. def *>[C](f: Fold[M, A, C]): Fold[M, A, C]

    Permalink

    zip with another fold, running this one only for its side effects

  6. def <*[C](f: Fold[M, A, C]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    zip with another fold only for its side effects

  7. def <*>[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }

    Permalink

    zip 2 folds to return a pair of values.

    zip 2 folds to return a pair of values. alias for zip

  8. def <+*(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    alias for observeNextState

  9. def <-*(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    alias for observeState

  10. def <<+*(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    alias for observeWithNextState

  11. def <<-*(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    alias for observeWithState

  12. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def as[C](c: ⇒ C): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }

    Permalink

    equivalent of the as method for functors, added here for easier type inference

  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def compose[C](f2: Fold[M, B, C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }

    Permalink

    pipe the output of this fold into another fold

  17. def contraFlatMap[C](f: (C) ⇒ M[A]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    contra flatmap the input values

  18. def contramap[C](f: (C) ⇒ A): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    contramap the input values

  19. def contramapFilter[C](f: (C) ⇒ Option[A]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    combine contramap and preFilter

  20. def endWith(action: M[Unit]): Fold[M, A, B]

    Permalink
  21. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def flattenOption: Fold[M, Option[A], B] { ... /* 2 definitions in type refinement */ }

    Permalink

    fold only the non empty values

  25. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. def into[M1[_]](implicit nat: ~>[M, M1], m: Monad[M1]): Fold[M1, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def map[C](f: (B) ⇒ C): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }

    Permalink

    map the output value

  30. def mapFlatten[C](f: (B) ⇒ M[C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }

    Permalink

    flatMap the output value

  31. def monadic[M1[_]](implicit nat: ~>[M, M1], m: Monad[M1]): Fold[M1, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. def nest[F[_], C](f: (C) ⇒ F[A])(implicit monoid: Monoid[B], foldable: Foldable[F]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    create a fold that will run this fold repeatedly on input elements and collect all results

  34. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. def observe[C](f: Fold[M, A, C]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    alias for <*

  37. def observeNextState(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    observe the next state

  38. def observeState(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    observe the current state

  39. def observeWithNextState(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    observe both the input value and the next state

  40. def observeWithState(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    observe both the input value and the current state

  41. def observedBy[C](f: Fold[M, A, C]): Fold[M, A, C]

    Permalink

    alias for *>

  42. def pipe[C](f: Fold[M, B, C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }

    Permalink

    run another fold on the end result

  43. def preCollect[C](pf: PartialFunction[C, A]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    similar to contramapFilter, but use a partial function

  44. def preFilter(f: (A) ⇒ Boolean): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }

    Permalink

    filter the input values

  45. def run[F[_]](foldable: F[A])(implicit arg0: Foldable[F]): M[B]

    Permalink

    run a Fold with a Foldable instance

  46. def run1(a: A): M[B]

    Permalink

    run over one element

  47. def startWith(action: M[Unit]): Fold[M, A, B]

    Permalink
  48. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. def void: Fold[M, A, Unit] { ... /* 2 definitions in type refinement */ }

    Permalink

    equivalent of the void method for functors, added here for easier type inference

  51. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. def zip[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }

    Permalink

    zip 2 folds to return a pair of values.

    zip 2 folds to return a pair of values. alias for <*>

Inherited from AnyRef

Inherited from Any

Ungrouped