FSharpx.Collections


DList Module

Functions and values

Function or value Description

DList.append left right

Full Usage: DList.append left right

Parameters:
Returns: DList<'a>

O(1). Returns a new DList of two lists.

left : DList<'a>
right : DList<'a>
Returns: DList<'a>

DList.cons hd tl

Full Usage: DList.cons hd tl

Parameters:
Returns: DList<'a>

O(1). Returns a new DList with the element added to the beginning.

hd : 'a
tl : DList<'a>
Returns: DList<'a>

DList.empty

Full Usage: DList.empty

Returns: DList<'T>

O(1). Returns DList of no elements.

Returns: DList<'T>

DList.fold f seed l

Full Usage: DList.fold f seed l

Parameters:
    f : 'a -> 'b -> 'a
    seed : 'a
    l : DList<'b>

Returns: 'a

Fold walks the DList using constant stack space. Implementation is from Norman Ramsey. See http://stackoverflow.com/questions/5324623/functional-o1-append-and-on-iteration-from-first-element-list-data-structure/5334068#5334068

f : 'a -> 'b -> 'a
seed : 'a
l : DList<'b>
Returns: 'a

DList.head l

Full Usage: DList.head l

Parameters:
Returns: 'a

O(log n). Returns the first element.

l : DList<'a>
Returns: 'a

DList.isEmpty l

Full Usage: DList.isEmpty l

Parameters:
Returns: bool

O(1). Returns true if the DList has no elements.

l : DList<'a>
Returns: bool

DList.length l

Full Usage: DList.length l

Parameters:
Returns: int

O(1). Returns the count of elements.

l : DList<'a>
Returns: int

DList.ofSeq s

Full Usage: DList.ofSeq s

Parameters:
    s : seq<'a>

Returns: DList<'a>

O(n). Returns a DList of the seq.

s : seq<'a>
Returns: DList<'a>

DList.singleton x

Full Usage: DList.singleton x

Parameters:
    x : 'a

Returns: DList<'a>

O(1). Returns DList of one elements.

x : 'a
Returns: DList<'a>

DList.snoc l x

Full Usage: DList.snoc l x

Parameters:
Returns: DList<'a>

O(1). Returns a new DList with the element added to the end.

l : DList<'a>
x : 'a
Returns: DList<'a>

DList.tail l

Full Usage: DList.tail l

Parameters:
Returns: DList<'a>

O(log n). Returns a new DList of the elements trailing the first element.

l : DList<'a>
Returns: DList<'a>

DList.toArray l

Full Usage: DList.toArray l

Parameters:
Returns: 'a[]
l : DList<'a>
Returns: 'a[]

DList.toList l

Full Usage: DList.toList l

Parameters:
Returns: 'a list
l : DList<'a>
Returns: 'a list

DList.toSeq l

Full Usage: DList.toSeq l

Parameters:
Returns: seq<'a>

O(n). Returns a seq of the DList elements.

l : DList<'a>
Returns: seq<'a>