Packages

sealed abstract class Free[S[_], A] extends Product with Serializable

A free operational monad for some functor S. Binding is done using the heap instead of the stack, allowing tail-call elimination.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Free
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean
    Definition Classes
    Equals
  2. abstract def productArity: Int
    Definition Classes
    Product
  3. abstract def productElement(n: Int): Any
    Definition Classes
    Product

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def compile[T[_]](f: FunctionK[S, T]): Free[T, A]

    Compile your free monad into another language by changing the suspension functor using the given natural transformation f.

    Compile your free monad into another language by changing the suspension functor using the given natural transformation f.

    If your natural transformation is effectful, be careful. These effects will be applied by compile.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def flatMap[B](f: (A) ⇒ Free[S, B]): Free[S, B]

    Bind the given continuation to the result of this computation.

    Bind the given continuation to the result of this computation. All left-associated binds are reassociated to the right.

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

    Catamorphism.

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

  12. final def foldMap[M[_]](f: FunctionK[S, M])(implicit M: Monad[M]): M[A]

    Catamorphism for Free.

    Catamorphism for Free.

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

    This method uses tailRecM to provide stack-safety.

  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def go(f: (S[Free[S, A]]) ⇒ Free[S, A])(implicit S: Functor[S]): A

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

  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def inject[G[_]](implicit ev: InjectK[S, G]): Free[G, A]

    Lift into G (typically a EitherK) given InjectK.

    Lift into G (typically a EitherK) given InjectK. Analogous to Free.inject but lifts programs rather than constructors.

    scala> type Lo[A] = cats.data.EitherK[List, Option, A]
    defined type alias Lo
    
    scala> val fo = Free.liftF(Option("foo"))
    fo: cats.free.Free[Option,String] = Free(...)
    
    scala> fo.inject[Lo]
    res4: cats.free.Free[Lo,String] = Free(...)
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def map[B](f: (A) ⇒ B): Free[S, B]
  19. final def mapK[T[_]](f: ~>[S, T]): Free[T, A]

    Modify the functor context S using transformation f.

    Modify the functor context S using transformation f.

    This is effectively compiling your free monad into another language by changing the suspension functor using the given natural transformation f.

    If your natural transformation is effectful, be careful. These effects will be applied by mapK.

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def productIterator: Iterator[Any]
    Definition Classes
    Product
  24. def productPrefix: String
    Definition Classes
    Product
  25. final def resume(implicit S: Functor[S]): Either[S[Free[S, A]], A]

    Evaluate a single layer of the free monad.

    Evaluate a single layer of the free monad.

    Annotations
    @tailrec()
  26. final def run(implicit S: Comonad[S]): A

    Run to completion, using the given comonad to extract the resumption.

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

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

  28. final def runTailRec(implicit S: Monad[S]): S[A]

    Run to completion, using monadic recursion to evaluate the resumption in the context of S.

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

    Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.

    Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.

    Annotations
    @tailrec()
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. final def toFreeT[G[_]](implicit arg0: Applicative[G]): FreeT[S, G, A]
  32. def toString(): String
    Definition Classes
    Free → AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped