scala.collection.immutable.Stream

object cons

[source: scala/collection/immutable/Stream.scala]

object cons
extends AnyRef
An alternative way of building and matching Streams using Stream.cons(hd, tl).
Method Summary
def apply [A](hd : A, tl : => Stream[A]) : Cons[A]
A stream consisting of a given first element and remaining elements
def unapply [A](xs : Stream[A]) : Option[(A, Stream[A])]
Maps a stream to its head and tail
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def apply[A](hd : A, tl : => Stream[A]) : Cons[A]
A stream consisting of a given first element and remaining elements
Parameters
hd - The first element of the result stream
tl - The remaining elements of the result stream

def unapply[A](xs : Stream[A]) : Option[(A, Stream[A])]
Maps a stream to its head and tail