[Home] Module Microsoft.FSharp.Collections.LazyList


Values

ValueDescription
val append : LazyList<'T> -> LazyList<'T> -> LazyList<'T>
Return the stream which contains on demand the elements of the first stream followed by the elements of the second list
val combine :
  LazyList<'T1> -> LazyList<'T2> -> LazyList<'T1 * 'T2>
Return the stream which contains on demand the pair of elements of the first and second list
val concat : LazyList<LazyList<'T>> -> LazyList<'T>
Return the stream which contains on demand the list of elements of the list of lazy lists.
val cons : 'T -> LazyList<'T> -> LazyList<'T>
Return a new stream which contains on demand the given item followed by the given stream.
val consf : 'T -> (unit -> LazyList<'T>) -> LazyList<'T>
Return a new stream which contains on demand the given item followed by the stream returned by the given computation. The computation is not executed until the elements of the stream are consumed. The computation is only executed once.
val delayed : (unit -> LazyList<'T>) -> LazyList<'T>
Return a stream that is in effect the stream returned by the given computation. The given computation is not executed until the first element on the stream is consumed.
val drop : int -> LazyList<'T> -> LazyList<'T>
Return the stream without the first 'n' elements of the given stream. Does not force the evaluation of any cells in the stream.
val empty : unit -> LazyList<'T>
Evaluates to the stream that contains no items
val filter : ('T -> bool) -> LazyList<'T> -> LazyList<'T>
Return a new collection which on consumption will consist of only the elements of the collection for which the given predicate returns "true"
val find : ('T -> bool) -> LazyList<'T> -> 'T
Return the first element for which the given function returns true. Raise KeyNotFoundException if no such element exists.
val first : ('T -> bool) -> LazyList<'T> -> 'T option
Apply the given function to successive elements of the list, returning the first result where function returns Some(x) for some x. If the function never returns true, 'None' is returned.
val folds :
  ('State -> 'T -> 'State) ->
    'State -> LazyList<'T> -> LazyList<'State>
Return a new stream consisting of the results of applying the given accumulating function to successive elements of the stream
val get : LazyList<'T> -> ('T * LazyList<'T>) option
Get the first cell of the stream.
val hd : LazyList<'T> -> 'T
Return the first element of the stream. Raise 'Invalid_argument "hd"' if the stream is empty. Forces the evaluation of the first cell of the stream if it is not already evaluated.
val map : ('T -> 'U) -> LazyList<'T> -> LazyList<'U>
Build a new collection whose elements are the results of applying the given function to each of the elements of the collection.
val map2 :
  ('T1 -> 'T2 -> 'U) ->
    LazyList<'T1> -> LazyList<'T2> -> LazyList<'U>
Build a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise.
val nonempty : LazyList<'T> -> bool
Test if a stream contains at least one element. Forces the evaluation of the first element of the stream if it is not already evaluated.
val of_array : 'T array -> LazyList<'T>
Build a collection from the given array. This function will eagerly evaluate all of the stream (and thus may not terminate).
val of_list : 'T list -> LazyList<'T>
Build a collection from the given list. This function will eagerly evaluate all of the stream (and thus may not terminate).
val of_seq : seq<'T> -> LazyList<'T>
Build a new collection from the given enumerable object
val repeat : 'T -> LazyList<'T>
Return the stream which on consumption will consist of an infinite sequence of the given item
val take : int -> LazyList<'T> -> LazyList<'T>
Return the stream which on consumption will consist of at most 'n' elements of the given stream. Does not force the evaluation of any cells in the stream.
val tl : LazyList<'T> -> LazyList<'T>
Return the stream corresponding to the remaining items in the sequence. Raise 'Invalid_argument "tl"' if the stream is empty. Forces the evaluation of the first cell of the stream if it is not already evaluated.
val to_array : LazyList<'T> -> 'T array
Build an array from the given collection
val to_list : LazyList<'T> -> 'T list
Build a list from the given collection This function will eagerly evaluate all of the stream (and thus may not terminate).
val to_seq : LazyList<'T> -> seq<'T>
Return a view of the collection as an enumerable object
val unfold : ('State -> ('T * 'State) option) -> 'State -> LazyList<'T>
Return a stream that contains the elements returned by the given computation. The given computation is not executed until the first element on the stream is consumed. The given argument is passed to the computation. Subsequent elements in the stream are generated by again applying the residual 'b to the computation.

Active Patterns

Active PatternDescription
val ( |Cons|Nil| ) :
  LazyList<'T> -> Choice<('T * LazyList<'T>),unit>

See Also

Microsoft.FSharp.Collections


Documentation for assembly FSharp.PowerPack, version 1.9.6.16, generated using F# Programming Language version 1.9.6.16