FreeT

sealed abstract
class FreeT[S[_], M[_], A]
Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

final
def flatMap[B](f: A => FreeT[S, M, B]): FreeT[S, M, B]

Binds the given continuation to the result of this computation.

Binds the given continuation to the result of this computation.

def foldMap(f: NaturalTransformation[S, M])(implicit M0: BindRec[M], M1: Applicative[M]): M[A]

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

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

def hoist[N[_]](mn: NaturalTransformation[M, N]): FreeT[S, N, A]

Changes the underlying Monad for this FreeT, ie. turning this FreeT[S, M, A] into a FreeT[S, N, A].

Changes the underlying Monad for this FreeT, ie. turning this FreeT[S, M, A] into a FreeT[S, N, A].

def interpret[T[_]](st: NaturalTransformation[S, T])(implicit M: Functor[M]): FreeT[T, M, A]

Change the base functor S for a FreeT action.

Change the base functor S for a FreeT action.

final
def map[B](f: A => B)(implicit M: Applicative[M]): FreeT[S, M, B]
def resume(implicit S: Functor[S], M0: BindRec[M], M1: Applicative[M]): M[S[FreeT[S, M, A]] \/ A]

Evaluates a single layer of the free monad *

Evaluates a single layer of the free monad *

def resumeC(implicit M0: BindRec[M], M1: Applicative[M]): M[Coyoneda[S, FreeT[S, M, A]] \/ A]
def runM(interp: S[FreeT[S, M, A]] => M[FreeT[S, M, A]])(implicit S: Functor[S], M0: BindRec[M], M1: Applicative[M]): M[A]

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.

Deprecated methods

@deprecated("Alias for `hoist`", "7.3")
def hoistM[N[_]](mn: NaturalTransformation[M, N]): FreeT[S, N, A]
Deprecated
@deprecated("Alias for `hoist`", "7.3")
def hoistN[N[_]](mn: NaturalTransformation[M, N]): FreeT[S, N, A]
Deprecated
@deprecated("Alias for `interpret`", "7.3")
def interpretS[T[_]](st: NaturalTransformation[S, T])(implicit M: Functor[M]): FreeT[T, M, A]
Deprecated
@deprecated("Alias for `interpret`", "7.3")
def interpretT[T[_]](st: NaturalTransformation[S, T])(implicit M: Functor[M]): FreeT[T, M, A]
Deprecated