Folds

org.specs2.control.origami.Folds
See theFolds companion object
trait Folds

Typeclass instances and creation methods for folds

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Folds.type

Members list

Value members

Concrete methods

def bracket[A, C](init: Action[C])(step: (C, A) => Action[C])(close: C => Finalizer): Fold[Action, A, Unit]
def fromFoldLeft[M[_], A, B](b: B)(f: (B, A) => M[B])(using m: Monad[M]): Fold[M, A, B] { type S = B; }

Attributes

Returns

a fold from arguments of a fold left

def fromMonoidMap[M[_], A, O](f: A => O)(using evidence$2: Monoid[O], m: Monad[M]): Fold[M, A, O] { type S = O; }

Attributes

Returns

a fold which uses a Monoid to accumulate elements

def fromMonoidMapEval[M[_], A, O](f: A => M[O])(using evidence$3: Monoid[O], m: Monad[M]): Fold[M, A, O] { type S = O; }

Attributes

Returns

a fold which uses a Monoid to accumulate elements

def fromSink[M[_], A](action: A => M[Unit])(using m: Monad[M]): Fold[M, A, Unit]
def fromStart[M[_], A, S1](action: M[S1])(using m: Monad[M]): Fold[M, A, S1] { type S = S1; }

Attributes

Returns

a fold with just a start action

def list[A]: Fold[Id, A, List[A]]

Attributes

Returns

a Fold which simply accumulates elements into a List