case class Cofree[S[+_], +A](head: A, tail: S[Cofree[S, A]])(implicit S: Functor[S]) extends Product with Serializable
A cofree comonad for some functor S
, i.e. an S
-branching stream.
- Source
- Cofree.scala
- Alphabetic
- By Inheritance
- Cofree
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
=>>[B](f: (Cofree[S, A]) ⇒ B): Cofree[S, B]
Alias for
extend
-
final
def
applyCofree[B](f: (A) ⇒ B, g: (Cofree[S, A]) ⇒ Cofree[S, B]): Cofree[S, B]
Applies
f
to the head andg
through the tail. -
final
def
applyTail[B](b: B, g: (Cofree[S, A]) ⇒ Cofree[S, B]): Cofree[S, B]
Replaces the head with
b
and appliesg
through the tail. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
copure: A
Alias for
head
, for compatibility with Scalaz 6 -
final
def
duplicate: Cofree[S, Cofree[S, A]]
Redecorates the structure with values representing entire substructures.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
extend[B](f: (Cofree[S, A]) ⇒ B): Cofree[S, B]
Redecorates this structure with a computation whose context is the entire structure under that value.
-
final
def
extract: A
Alias for
head
, for compatibility with Scalaz 6 -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- val head: A
-
final
def
inject[B](b: B): Cofree[S, B]
Injects a constant value into this structure.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def map[B](f: (A) ⇒ B): Cofree[S, B]
-
final
def
mapBranching[T[+_]](f: ~>[S, T])(implicit arg0: Functor[T]): Cofree[T, A]
Changes the branching functor by the given natural transformation.
-
final
def
mapFirstBranching(f: ~>[S, S]): Cofree[S, A]
Modifies the first branching with the given natural transformation.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
out: S[Cofree[S, A]]
Alias for
tail
, for compatibility with Scalaz 6 -
def
scanr[B](g: (A, S[Cofree[S, B]]) ⇒ B): Cofree[S, B]
Folds over this cofree structure, returning all the intermediate values in a new structure.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val tail: S[Cofree[S, A]]
-
final
def
toPair: (A, S[Cofree[S, A]])
Returns the components of this structure in a tuple.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
zap[G[+_], B](fs: Free[G, (A) ⇒ B])(implicit G: Functor[G], d: Zap[S, G]): B
Applies a function in a monad to the corresponding value in this comonad, annihilating both.
-
final
def
zapWith[G[+_], B, C](bs: Free[G, B])(f: (A, B) ⇒ C)(implicit G: Functor[G], d: Zap[S, G]): C
Applies a function
f
to a value in this comonad and a corresponding value in the dual monad, annihilating both.