scala / 3.2 / scala / collection / immutable / lazylist$$cons$.html

Object LazyList.cons

object cons

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

Supertypes
Self type

Concrete methods

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

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

Value parameters
hd

The first element of the result lazy list

tl

The remaining elements of the result lazy list

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

Maps a lazy list to its head and tail

© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/collection/immutable/LazyList$$cons$.html