trait Fold[R, 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[R, A, B]
- Alphabetic
- By Inheritance
- Fold
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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[R, A, C]): Fold[R, A, (B, C)] { type S = (Fold.this.S, f.S) }
fanout = zip in the Arrow terminology
-
def
***[V, W](f: Fold[R, V, W]): Fold[R, (A, V), (B, W)] { type S = (Fold.this.S, f.S) }
parallel composition
-
def
*>[C](f: Fold[R, A, C]): Fold[R, A, C]
zip with another fold, running this one only for its side effects
-
def
<*[C](f: Fold[R, A, C]): Fold[R, A, B] { type S = (Fold.this.S, f.S) }
zip with another fold only for its side effects
-
def
<*>[C](f: Fold[R, A, C]): Fold[R, A, (B, C)] { type S = (Fold.this.S, f.S) }
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for zip
-
def
<+*(sink: Sink[R, S]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
alias for observeNextState
-
def
<-*(sink: Sink[R, S]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
alias for observeState
-
def
<<+*(sink: Sink[R, (A, S)]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
alias for observeWithNextState
-
def
<<-*(sink: Sink[R, (A, S)]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
alias for observeWithState
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
as[C](c: ⇒ C): Fold[R, A, C] { type S = Fold.this.S }
equivalent of the as method for functors, added here for easier type inference
-
def
asFoldable[F[_]](implicit monoid: Monoid[B], foldable: Foldable[F]): Fold[R, F[A], B] { type S = org.specs2.control.eff.Eff[R,B] }
create a fold that will run this fold repeatedly on input elements and collect all results
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
compose[C](f2: Fold[R, B, C]): Fold[R, A, C] { type S = org.specs2.control.eff.Eff[R,(Fold.this.S, f2.S)] }
pipe the output of this fold into another fold
-
def
contramap[C](f: (C) ⇒ A): Fold[R, C, B] { type S = Fold.this.S }
contramap the input values
- def endWith(action: Eff[R, Unit]): Fold[R, A, B] { type S = Fold.this.S }
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
into[U](implicit intoPoly: IntoPoly[R, U]): Fold[U, A, B] { type S = Fold.this.S }
use a transformation to go from effect stack to another
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[C](f: (B) ⇒ C): Fold[R, A, C] { type S = Fold.this.S }
map the output value
-
def
mapFlatten[C](f: (B) ⇒ Eff[R, C]): Fold[R, A, C] { type S = Fold.this.S }
flatMap the output value
-
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[R, C, B] { type S = org.specs2.control.eff.Eff[R,B] }
create a fold that will run this fold repeatedly on input elements and collect all results
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
observe[C](f: Fold[R, A, C]): Fold[R, A, B] { type S = (Fold.this.S, f.S) }
alias for <*
-
def
observeNextState(sink: Sink[R, S]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
observe the next state
-
def
observeState(sink: Sink[R, S]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
observe the current state
-
def
observeWithNextState(sink: Sink[R, (A, S)]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
observe both the input value and the next state
-
def
observeWithState(sink: Sink[R, (A, S)]): Fold[R, A, B] { type S = (Fold.this.S, sink.S) }
observe both the input value and the current state
-
def
observedBy[C](f: Fold[R, A, C]): Fold[R, A, C]
alias for *>
-
def
pipe[C](f: Fold[R, B, C]): Fold[R, A, C] { type S = Fold.this.S }
run another fold on the end result
-
def
run[F[_]](foldable: F[A])(implicit arg0: Foldable[F]): Eff[R, B]
run a Fold with a Foldable instance
-
def
run1(a: A): Eff[R, B]
run over one element
- def startWith(action: Eff[R, Unit]): Fold[R, 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[R, A, Unit] { type S = Fold.this.S }
equivalent of the void method for functors, added here for easier type inference
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zip[C](f: Fold[R, A, C]): Fold[R, A, (B, C)] { type S = (Fold.this.S, f.S) }
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for <*>