sealed abstract
class
CorecursiveList[A] extends AnyRef
Type Members
-
abstract
type
S
Abstract Value Members
-
abstract
val
init: S
-
abstract
val
step: (S) ⇒ Maybe[(S, A)]
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
The corecursive list; i.e. the arguments to
unfold
saved off to a data structure. Generally does not have methods itself; as with scalaz.NonEmptyList, it provides typeclass instances instead, and you typically import typeclass syntax to get methods.The corecursive list can be a very efficient way to represent "listlike" things in some cases; because it is so unlike "normal" collections, though, it's important to understand how its operations are implemented and what their performance characteristics are going to be. For example, using
cons
iteratively to add a bunch of elements to the beginning of a scala.collection.immutable.List is very efficient; it's very inefficient for corecursive list.Operations are generally designed to preserve the isomorphism with scalaz.EphemeralStream; for example,
ap
could be a "zipping"ap
, but instead is a less efficient "combination" style. This means that the scalaz.Monad has the same behavior as that of scalaz.EphemeralStream and more traditional strict list structures.