Class/Object

scalaz

Free

Related Docs: object Free | package scalaz

Permalink

sealed abstract class Free[S[_], A] extends AnyRef

A free monad for a type constructor S. Binding is done using the heap instead of the stack, allowing tail-call elimination.

Source
Free.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Free
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def >>=[B](f: (A) ⇒ Free[S, B]): Free[S, B]

    Permalink

    Alias for flatMap

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. final def bounce(f: (S[Free[S, A]]) ⇒ Free[S, A])(implicit S: Functor[S]): Free[S, A]

    Permalink

    Runs a single step, using a function that extracts the resumption from its suspension functor.

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collect[B](implicit ev: =:=[Free[S, A], Source[B, A]]): (Vector[B], A)

    Permalink

    Runs a Source all the way to the end, tail-recursively, collecting the produced values.

  9. def drain[E, B](source: Source[E, B])(implicit ev: =:=[Free[S, A], Sink[E, A]]): (A, B)

    Permalink

    Feed the given source to this Sink.

  10. def drive[E, B](sink: Sink[Option[E], B])(implicit ev: =:=[Free[S, A], Source[E, A]]): (A, B)

    Permalink

    Drive this Source with the given Sink.

  11. def duplicateF: Free[[β$11$]Free[S, β$11$], A]

    Permalink

    Duplication in Free as a comonad in the endofunctor category.

  12. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def extendF[T[_]](f: ~>[[β$14$]Free[S, β$14$], T]): Free[T, A]

    Permalink

    Extension in Free as a comonad in the endofunctor category.

  15. def extractF(implicit S: Monad[S]): S[A]

    Permalink

    Extraction from Free as a comonad in the endofunctor category.

  16. def feed[E](ss: Stream[E])(implicit ev: =:=[Free[S, A], Sink[E, A]]): A

    Permalink

    Feed the given stream to this Source.

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def flatMap[B](f: (A) ⇒ Free[S, B]): Free[S, B]

    Permalink

    Binds the given continuation to the result of this computation.

  19. final def flatMapSuspension[T[_]](f: ~>[S, [β$9$]Free[T, β$9$]]): Free[T, A]

    Permalink

    Substitutes a free monad over the given functor into the suspension functor of this program.

    Substitutes a free monad over the given functor into the suspension functor of this program. Free is a monad in an endofunctor category and this is its monadic bind.

  20. final def fold[B](r: (A) ⇒ B, s: (S[Free[S, A]]) ⇒ B)(implicit S: Functor[S]): B

    Permalink

    Catamorphism.

    Catamorphism. Run the first given function if Return, otherwise, the second given function.

  21. final def foldMap[M[_]](f: ~>[S, M])(implicit M: Monad[M]): M[A]

    Permalink

    Catamorphism for Free.

    Catamorphism for Free. Runs to completion, mapping the suspension with the given transformation at each step and accumulating into the monad M.

  22. final def foldMapRec[M[_]](f: ~>[S, M])(implicit M: Applicative[M], B: BindRec[M]): M[A]

    Permalink
  23. final def foldRight[G[_]](z: ~>[Id.Id, G])(f: ~>[[α]S[G[α]], G])(implicit S: Functor[S]): G[A]

    Permalink

    Folds this free recursion to the right using the given natural transformations.

  24. final def foldRun[B](b: B)(f: (B, S[Free[S, A]]) ⇒ (B, Free[S, A]))(implicit S: Functor[S]): (B, A)

    Permalink

    Runs to completion, allowing the resumption function to thread an arbitrary state of type B.

  25. final def foldRunM[M[_], B](b: B)(f: ~>[[α](B, S[α]), [α]M[(B, α)]])(implicit M0: Applicative[M], M1: BindRec[M]): M[(B, A)]

    Permalink

    Variant of foldRun that allows to interleave effect M at each step.

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def go(f: (S[Free[S, A]]) ⇒ Free[S, A])(implicit S: Functor[S]): A

    Permalink

    Runs to completion, using a function that extracts the resumption from its suspension functor.

  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. final def map[B](f: (A) ⇒ B): Free[S, B]

    Permalink
  31. final def mapFirstSuspension(f: ~>[S, S]): Free[S, A]

    Permalink

    Modifies the first suspension with the given natural transformation.

  32. final def mapSuspension[T[_]](f: ~>[S, T]): Free[T, A]

    Permalink

    Changes the suspension functor by the given natural transformation.

  33. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  34. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  36. final def resume(implicit S: Functor[S]): \/[S[Free[S, A]], A]

    Permalink

    Evaluates a single layer of the free monad *

    Evaluates a single layer of the free monad *

    Annotations
    @tailrec()
  37. final def run(implicit ev: =:=[Free[S, A], Trampoline[A]]): A

    Permalink

    Runs a trampoline all the way to the end, tail-recursively.

  38. final def runM[M[_]](f: (S[Free[S, A]]) ⇒ M[Free[S, A]])(implicit S: Functor[S], M: Monad[M]): M[A]

    Permalink

    Runs to completion, using a function that maps the resumption from S to a monad M.

    Runs to completion, using a function that maps the resumption from S to a monad M.

    Since

    7.0.1

  39. final def runRecM[M[_]](f: (S[Free[S, A]]) ⇒ M[Free[S, A]])(implicit S: Functor[S], M: Applicative[M], B: BindRec[M]): M[A]

    Permalink

    Run Free using constant stack.

  40. final def step: Free[S, A]

    Permalink

    Evaluate one layer in the free monad, re-associating any left-nested binds to the right and pulling the first suspension to the top.

    Evaluate one layer in the free monad, re-associating any left-nested binds to the right and pulling the first suspension to the top.

    Annotations
    @tailrec()
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def toFreeT(implicit S: Functor[S]): FreeT[S, Id.Id, A]

    Permalink
  43. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def zap[G[_], B](fs: Cofree[G, (A) ⇒ B])(implicit S: Functor[S], d: Zap[S, G]): B

    Permalink

    Applies a function in a comonad to the corresponding value in this monad, annihilating both.

  48. final def zapWith[G[_], B, C](bs: Cofree[G, B])(f: (A, B) ⇒ C)(implicit S: Functor[S], d: Zap[S, G]): C

    Permalink

    Applies a function f to a value in this monad and a corresponding value in the dual comonad, annihilating both.

  49. final def zipWith[B, C](tb: Free[S, B])(f: (A, B) ⇒ C): Free[S, C]

    Permalink

    Interleave this computation with another, combining the results with the given function.

Inherited from AnyRef

Inherited from Any

Ungrouped