cons

object cons

An alternative way of building and matching Streams using Stream.cons(hd, tl).

An alternative way of building and matching Streams using Stream.cons(hd, tl).

class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[A](hd: A, tl: => Stream[A]): Stream[A]

A stream consisting of a given first element and remaining elements

A stream consisting of a given first element and remaining elements

Value Params
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

Maps a stream to its head and tail