trait Fold[M[_], A, B] extends AnyRef
A Fold is a "left fold" over a data structure with:
- a 'start' value
- a 'fold' method to accumulate state
- an 'end' method to finalize the result
Both 'start' and 'end' have an effect which allows the whole folding to take place inside a context.
- Self Type
- Fold[M, A, B]
- Alphabetic
- By Inheritance
- Fold
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type S
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def &&&[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }
fanout = zip in the Arrow terminology
- def ***[V, W](f: Fold[M, V, W]): Fold[M, (A, V), (B, W)] { ... /* 2 definitions in type refinement */ }
parallel composition
- def *>[C](f: Fold[M, A, C]): Fold[M, A, C]
zip with another fold, running this one only for its side effects
- def <*[C](f: Fold[M, A, C]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
zip with another fold only for its side effects
- def <*>[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for zip
- def <+*(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
alias for observeNextState
- def <-*(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
alias for observeState
- def <<+*(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
alias for observeWithNextState
- def <<-*(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
alias for observeWithState
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def as[C](c: => C): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }
equivalent of the as method for functors, added here for easier type inference
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[C](f2: Fold[M, B, C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }
pipe the output of this fold into another fold
- def contraflatMap[C](f: (C) => M[A]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }
contramap the input values with effects
- def contramap[C](f: (C) => A): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }
contramap the input values
- def endWith(action: M[Unit]): Fold[M, A, B] { type S = Fold.this.S }
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def into[M1[_]](implicit nat: ~>[M, M1], m: Monad[M1]): Fold[M1, A, B] { ... /* 2 definitions in type refinement */ }
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[C](f: (B) => C): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }
map the output value
- def mapFlatten[C](f: (B) => M[C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }
flatMap the output value
- def monadic[M1[_]](implicit nat: ~>[M, M1], m: Monad[M1]): Fold[M1, A, B] { ... /* 2 definitions in type refinement */ }
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nest[F[_], C](f: (C) => F[A])(implicit monoid: Monoid[B], foldable: Foldable[F]): Fold[M, C, B] { ... /* 2 definitions in type refinement */ }
create a fold that will run this fold repeatedly on input elements and collect all results
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def observe[C](f: Fold[M, A, C]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
alias for <*
- def observeNextState(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
observe the next state
- def observeState(sink: Sink[M, S]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
observe the current state
- def observeWithNextState(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
observe both the input value and the next state
- def observeWithState(sink: Sink[M, (A, S)]): Fold[M, A, B] { ... /* 2 definitions in type refinement */ }
observe both the input value and the current state
- def observedBy[C](f: Fold[M, A, C]): Fold[M, A, C]
alias for *>
- def pipe[C](f: Fold[M, B, C]): Fold[M, A, C] { ... /* 2 definitions in type refinement */ }
run another fold on the end result
- def run[F[_]](foldable: F[A])(implicit arg0: Foldable[F]): M[B]
run a Fold with a Foldable instance
- def run1(a: A): M[B]
run over one element
- def startWith(action: M[Unit]): Fold[M, A, B] { type S = Fold.this.S }
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def void: Fold[M, A, Unit] { ... /* 2 definitions in type refinement */ }
equivalent of the void method for functors, added here for easier type inference
- 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()
- def zip[C](f: Fold[M, A, C]): Fold[M, A, (B, C)] { ... /* 2 definitions in type refinement */ }
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for <*>