object CorecursiveList extends CorecursiveListInstances
- Source
- CorecursiveList.scala
- Alphabetic
- By Inheritance
- CorecursiveList
- CorecursiveListInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- def apply[S, A](init: S)(step: (S) => Maybe[(S, A)]): CorecursiveList[A]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def cons[A](a: A, fa: CorecursiveList[A]): CorecursiveList[A]
A frightfully inefficient way to add elements to the beginning of a corecursive list.
A frightfully inefficient way to add elements to the beginning of a corecursive list. It is correct, and reasonable enough for one-or-two-time use on a particular list, but be warned that iterative cons is necessarily a very inefficient way to build up a
CorecursiveList
.You can see why by taking a look at its choice of state.
cons
adds aMaybe
to the state of the tail list, so if you cons four elements ontosomeCList
, its state will beMaybe[Maybe[Maybe[Maybe[someCList.S]]]]
, and so on. This is utterly unsustainable for iterative consing.Instead, try
apply
, or another more wholemeal-style combinator. You might also cons up a different structure, then transform that to aCorecursiveList
wholesale andappend
orplus
it on; that's reasonably efficient, too. - implicit val covariantInstance: MonadPlus[CorecursiveList] with Alt[CorecursiveList] with Foldable[CorecursiveList] with IsEmpty[CorecursiveList] with Align[CorecursiveList] with Zip[CorecursiveList]
- val ephemeralStreamIso: Isomorphism.<~>[EphemeralStream, CorecursiveList]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- implicit def equalInstance[A](implicit arg0: Equal[A]): Equal[CorecursiveList[A]]
- Definition Classes
- CorecursiveListInstances
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromLazyList[A](s: LazyList[A]): CorecursiveList[A]
- val fromList: ~>[LinearSeq, CorecursiveList]
Any
LinearSeq
converts to aCorecursiveList
efficiently.Any
LinearSeq
converts to aCorecursiveList
efficiently. No natural transformation fromCorecursiveList
toList
exists, because representation of infinite lists is not guaranteed. UsestreamIso
for such cases instead. - val fromVector: ~>[IndexedSeq, CorecursiveList]
Any
IndexedSeq
converts to aCorecursiveList
efficiently.Any
IndexedSeq
converts to aCorecursiveList
efficiently. No natural transformation fromCorecursiveList
toVector
exists, because representation of infinite lists is not guaranteed. UsestreamIso
for such cases instead. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lazyListIso: Isomorphism.<~>[LazyList, CorecursiveList]
- implicit def monoidInstance[A]: Monoid[CorecursiveList[A]]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def orderInstance[A](implicit arg0: Order[A]): Order[CorecursiveList[A]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()