Class/Object

cats.free

Cofree

Related Docs: object Cofree | package free

Permalink

final case class Cofree[S[_], A](head: A, tail: Eval[S[Cofree[S, A]]]) extends Product with Serializable

A free comonad for some branching functor S. Branching is done lazily using Eval. A tree with data at the branches, as opposed to Free which is a tree with data at the leaves. Not an instruction set functor made into a program monad as in Free, but an instruction set's outputs as a functor made into a tree of the possible worlds reachable using the instruction set.

This Scala implementation of Cofree and its usages are derived from Scalaz's Cofree, originally written by Rúnar Bjarnason.

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

Instance Constructors

  1. new Cofree(head: A, tail: Eval[S[Cofree[S, A]]])

    Permalink

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 asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def coflatMap[B](f: (Cofree[S, A]) ⇒ B)(implicit S: Functor[S]): Cofree[S, B]

    Permalink

    Map f over each subtree of the computation.

  7. def coflatten(implicit S: Functor[S]): Cofree[S, Cofree[S, A]]

    Permalink

    Replace each node in the computation with the subtree from that node downwards

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

    Permalink
    Definition Classes
    AnyRef
  9. def extract: A

    Permalink

    Alias for head.

  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def forceAll(implicit S: Functor[S]): Cofree[S, A]

    Permalink

    Evaluate the entire Cofree tree.

  12. def forceTail: Cofree[S, A]

    Permalink

    Evaluate just the tail.

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. val head: A

    Permalink
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def map[B](f: (A) ⇒ B)(implicit S: Functor[S]): Cofree[S, B]

    Permalink

    Map over head and inner S[_] branches.

  17. def mapBranchingRoot(nat: ~>[S, S])(implicit S: Functor[S]): Cofree[S, A]

    Permalink

    Transform the branching functor at the root of the Cofree tree.

  18. def mapBranchingS[T[_]](nat: ~>[S, T])(implicit S: Functor[S]): Cofree[T, A]

    Permalink

    Transform the branching functor, using the S functor to perform the recursion.

  19. def mapBranchingT[T[_]](nat: ~>[S, T])(implicit T: Functor[T]): Cofree[T, A]

    Permalink

    Transform the branching functor, using the T functor to perform the recursion.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. val tail: Eval[S[Cofree[S, A]]]

    Permalink
  25. def tailForced: S[Cofree[S, A]]

    Permalink

    Evaluates and returns the tail of the computation.

  26. def transform[B](f: (A) ⇒ B, g: (Cofree[S, A]) ⇒ Cofree[S, B])(implicit S: Functor[S]): Cofree[S, B]

    Permalink

    Applies f to the head and g to the tail.

  27. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped