FSharpx.Collections


LazyList Module

Functions and values

Function or value Description

LazyList.append arg1 source

Full Usage: LazyList.append arg1 source

Parameters:
Returns: LazyList<'T>

O(1). Return the list which contains on demand the elements of the first list followed by the elements of the second list

arg0 : LazyList<'T>
source : LazyList<'T>
Returns: LazyList<'T>

LazyList.compareWith arg1 arg2 arg3

Full Usage: LazyList.compareWith arg1 arg2 arg3

Parameters:
Returns: int

O(n). Compares two lazy lists using the given comparison function, element by element. Both lists are evaluated until one of them is empty.

arg0 : 'T -> 'T -> int
arg1 : LazyList<'T>
arg2 : LazyList<'T>
Returns: int

LazyList.concat arg1

Full Usage: LazyList.concat arg1

Parameters:
Returns: LazyList<'T>

O(1). Return the list which contains on demand the list of elements of the list of lazy lists.

arg0 : LazyList<LazyList<'T>>
Returns: LazyList<'T>

LazyList.cons arg1 arg2

Full Usage: LazyList.cons arg1 arg2

Parameters:
Returns: LazyList<'T>

O(1). Return a new list which contains the given item followed by the given list.

arg0 : 'T
arg1 : LazyList<'T>
Returns: LazyList<'T>

LazyList.consDelayed arg1 arg2

Full Usage: LazyList.consDelayed arg1 arg2

Parameters:
Returns: LazyList<'T>

O(1). Return a new list which on consumption contains the given item followed by the list returned by the given computation. The

arg0 : 'T
arg1 : unit -> LazyList<'T>
Returns: LazyList<'T>

LazyList.delayed arg1

Full Usage: LazyList.delayed arg1

Parameters:
Returns: LazyList<'T>

O(1). Return a list that is in effect the list returned by the given computation. The given computation is not executed until the first element on the list is consumed.

arg0 : unit -> LazyList<'T>
Returns: LazyList<'T>

LazyList.drop count source

Full Usage: LazyList.drop count source

Parameters:
Returns: LazyList<'T>

O(n), where n is count. Return the list which on consumption will remove of at most 'n' elements of the input list.

count : int
source : LazyList<'T>
Returns: LazyList<'T>

LazyList.empty

Full Usage: LazyList.empty

Returns: LazyList<'T>

O(1). Evaluates to the list that contains no items

Returns: LazyList<'T>

LazyList.equalsWith arg1 arg2 arg3

Full Usage: LazyList.equalsWith arg1 arg2 arg3

Parameters:
Returns: bool

O(n). Checks if two lazy lists are equal using the given equality function, element by element. Both lists are evaluated until one of them is empty.

arg0 : 'T -> 'T -> bool
arg1 : LazyList<'T>
arg2 : LazyList<'T>
Returns: bool

LazyList.filter predicate source

Full Usage: LazyList.filter predicate source

Parameters:
    predicate : 'T -> bool
    source : LazyList<'T>

Returns: LazyList<'T>

O(1). Return a new collection which on consumption will consist of only the elements of the collection for which the given predicate returns "true"

predicate : 'T -> bool
source : LazyList<'T>
Returns: LazyList<'T>

LazyList.find predicate source

Full Usage: LazyList.find predicate source

Parameters:
    predicate : 'T -> bool
    source : LazyList<'T>

Returns: 'T

O(n), worst case. Return the first element for which the given function returns true. Raise KeyNotFoundException if no such element exists.

predicate : 'T -> bool
source : LazyList<'T>
Returns: 'T

LazyList.fold f s l

Full Usage: LazyList.fold f s l

Parameters:
    f : 'T1 -> 'T2 -> 'T1
    s : 'T1
    l : LazyList<'T2>

Returns: 'T1

O(n). /// it applies a function to each element of a list, passing an accumulating parameter from left to right,

f : 'T1 -> 'T2 -> 'T1
s : 'T1
l : LazyList<'T2>
Returns: 'T1

LazyList.head arg1

Full Usage: LazyList.head arg1

Parameters:
Returns: 'T

O(1). Return the first element of the list. Forces the evaluation of the first cell of the list if it is not already evaluated.

arg0 : LazyList<'T>
Returns: 'T

LazyList.isEmpty arg1

Full Usage: LazyList.isEmpty arg1

Parameters:
Returns: bool

O(1). Test if a list is empty. Forces the evaluation of the first element of the stream if it is not already evaluated.

arg0 : LazyList<'T>
Returns: bool

LazyList.iter action list

Full Usage: LazyList.iter action list

Parameters:
    action : 'T -> unit
    list : LazyList<'T>

O(n). Apply the given function to each element of the collection.

action : 'T -> unit
list : LazyList<'T>

LazyList.length list

Full Usage: LazyList.length list

Parameters:
Returns: int

O(n). Return the length of the list

list : LazyList<'T>
Returns: int

LazyList.map mapping source

Full Usage: LazyList.map mapping source

Parameters:
    mapping : 'T -> 'U
    source : LazyList<'T>

Returns: LazyList<'U>

O(1). Build a new collection whose elements are the results of applying the given function to each of the elements of the collection.

mapping : 'T -> 'U
source : LazyList<'T>
Returns: LazyList<'U>

LazyList.map2 mapping arg2 arg3

Full Usage: LazyList.map2 mapping arg2 arg3

Parameters:
Returns: LazyList<'U>

O(1). Build a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise.

mapping : 'T1 -> 'T2 -> 'U
arg1 : LazyList<'T1>
arg2 : LazyList<'T2>
Returns: LazyList<'U>

LazyList.mapAccum f s l

Full Usage: LazyList.mapAccum f s l

Parameters:
    f : 'T1 -> 'T2 -> 'T1 * 'T3
    s : 'T1
    l : LazyList<'T2>

Returns: 'T1 * LazyList<'T3>

O(n). Behaves like a combination of map and fold; it applies a function to each element of a list, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.

f : 'T1 -> 'T2 -> 'T1 * 'T3
s : 'T1
l : LazyList<'T2>
Returns: 'T1 * LazyList<'T3>

LazyList.ofArray arg1

Full Usage: LazyList.ofArray arg1

Parameters:
    arg0 : 'T array

Returns: LazyList<'T>

O(1). Build a collection from the given array. This function will eagerly evaluate all of the list (and thus may not terminate).

arg0 : 'T array
Returns: LazyList<'T>

LazyList.ofList arg1

Full Usage: LazyList.ofList arg1

Parameters:
    arg0 : 'T list

Returns: LazyList<'T>

O(1). Build a collection from the given list. This function will eagerly evaluate all of the list (and thus may not terminate).

arg0 : 'T list
Returns: LazyList<'T>

LazyList.ofSeq arg1

Full Usage: LazyList.ofSeq arg1

Parameters:
    arg0 : seq<'T>

Returns: LazyList<'T>

O(1). Build a new collection from the given enumerable object

arg0 : seq<'T>
Returns: LazyList<'T>

LazyList.repeat arg1

Full Usage: LazyList.repeat arg1

Parameters:
    arg0 : 'T

Returns: LazyList<'T>

O(1). Return the list which on consumption will consist of an infinite sequence of the given item

arg0 : 'T
Returns: LazyList<'T>

LazyList.rev arg1

Full Usage: LazyList.rev arg1

Parameters:
Returns: LazyList<'T>

Returns the reverse list.

arg0 : LazyList<'T>
Returns: LazyList<'T>

LazyList.scan folder arg2 source

Full Usage: LazyList.scan folder arg2 source

Parameters:
    folder : 'State -> 'T -> 'State
    arg1 : 'State
    source : LazyList<'T>

Returns: LazyList<'State>

O(1). Return a new list consisting of the results of applying the given accumulating function to successive elements of the list

folder : 'State -> 'T -> 'State
arg1 : 'State
source : LazyList<'T>
Returns: LazyList<'State>

LazyList.skip count source

Full Usage: LazyList.skip count source

Parameters:
Returns: LazyList<'T>

O(n), where n is count. Return the list which on consumption will skip the first 'n' elements of the input list.

count : int
source : LazyList<'T>
Returns: LazyList<'T>

LazyList.split arg1 arg2

Full Usage: LazyList.split arg1 arg2

Parameters:
Returns: 'T list * LazyList<'T>

Splits the list at the gicen index.

arg0 : LazyList<'T>
arg1 : int
Returns: 'T list * LazyList<'T>

LazyList.tail arg1

Full Usage: LazyList.tail arg1

Parameters:
Returns: LazyList<'T>

O(1). Return the list corresponding to the remaining items in the sequence. Forces the evaluation of the first cell of the list if it is not already evaluated.

arg0 : LazyList<'T>
Returns: LazyList<'T>

LazyList.take count source

Full Usage: LazyList.take count source

Parameters:
Returns: LazyList<'T>

O(n), where n is count. Return the list which on consumption will consist of at most 'n' elements of the input list.

count : int
source : LazyList<'T>
Returns: LazyList<'T>

LazyList.toArray arg1

Full Usage: LazyList.toArray arg1

Parameters:
Returns: 'T array

O(n). Build an array from the given collection

arg0 : LazyList<'T>
Returns: 'T array

LazyList.toList arg1

Full Usage: LazyList.toList arg1

Parameters:
Returns: 'T list

O(n). Build a non-lazy list from the given collection. This function will eagerly evaluate all of the list (and thus may not terminate).

arg0 : LazyList<'T>
Returns: 'T list

LazyList.toSeq arg1

Full Usage: LazyList.toSeq arg1

Parameters:
Returns: seq<'T>

O(n). Return a view of the collection as an enumerable object

arg0 : LazyList<'T>
Returns: seq<'T>

LazyList.tryFind predicate source

Full Usage: LazyList.tryFind predicate source

Parameters:
    predicate : 'T -> bool
    source : LazyList<'T>

Returns: 'T option

O(n), worst case. 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.

predicate : 'T -> bool
source : LazyList<'T>
Returns: 'T option

LazyList.tryHead arg1

Full Usage: LazyList.tryHead arg1

Parameters:
Returns: 'T option

O(1). Return option the first element of the list. Forces the evaluation of the first cell of the list if it is not already evaluated.

arg0 : LazyList<'T>
Returns: 'T option

LazyList.trySkip count source

Full Usage: LazyList.trySkip count source

Parameters:
Returns: LazyList<'T> option

O(n), where n is count. Return option the list which skips the first 'n' elements of the input list.

count : int
source : LazyList<'T>
Returns: LazyList<'T> option

LazyList.tryTail arg1

Full Usage: LazyList.tryTail arg1

Parameters:
Returns: LazyList<'T> option

O(1). Return option the list corresponding to the remaining items in the sequence. Forces the evaluation of the first cell of the list if it is not already evaluated.

arg0 : LazyList<'T>
Returns: LazyList<'T> option

LazyList.tryTake count source

Full Usage: LazyList.tryTake count source

Parameters:
Returns: LazyList<'T> option

O(n), where n is count. Return the list which on consumption will consist of at most 'n' elements of the input list.

count : int
source : LazyList<'T>
Returns: LazyList<'T> option

LazyList.tryUncons arg1

Full Usage: LazyList.tryUncons arg1

Parameters:
Returns: ('T * LazyList<'T>) option

O(1). Returns option tuple of head element and tail of the list.

arg0 : LazyList<'T>
Returns: ('T * LazyList<'T>) option

LazyList.uncons arg1

Full Usage: LazyList.uncons arg1

Parameters:
Returns: 'T * LazyList<'T>

O(1). Returns tuple of head element and tail of the list.

arg0 : LazyList<'T>
Returns: 'T * LazyList<'T>

LazyList.unfold arg1 arg2

Full Usage: LazyList.unfold arg1 arg2

Parameters:
    arg0 : 'State -> ('T * 'State) option
    arg1 : 'State

Returns: LazyList<'T>

O(1). Return a list that contains the elements returned by the given computation. The given computation is not executed until the first element on the list is consumed. The given argument is passed to the computation. Subsequent elements in the list are generated by again applying the residual 'b to the computation.

arg0 : 'State -> ('T * 'State) option
arg1 : 'State
Returns: LazyList<'T>

LazyList.zip arg1 arg2

Full Usage: LazyList.zip arg1 arg2

Parameters:
Returns: LazyList<'T1 * 'T2>

O(1). Return the list which contains on demand the pair of elements of the first and second list

arg0 : LazyList<'T1>
arg1 : LazyList<'T2>
Returns: LazyList<'T1 * 'T2>

Active patterns

Active pattern Description

LazyList.(|Cons|Nil|) arg1

Full Usage: LazyList.(|Cons|Nil|) arg1

Parameters:
Returns: Choice<('T * LazyList<'T>), unit>
arg0 : LazyList<'T>
Returns: Choice<('T * LazyList<'T>), unit>