cons

object cons

An alternative way of building and matching lazy lists using LazyList.cons(hd, tl).

An alternative way of building and matching lazy lists using LazyList.cons(hd, tl).

class Object
trait Matchable
class Any

Value members

Concrete methods

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

A lazy list consisting of a given first element and remaining elements

A lazy list consisting of a given first element and remaining elements

Value Params
hd

The first element of the result lazy list

tl

The remaining elements of the result lazy list

def unapply[A](xs: LazyList[A]): Option[(A, LazyList[A])]

Maps a lazy list to its head and tail

Maps a lazy list to its head and tail