FSharpPlus


DList Module

Functions and values

Function or value Description

add x l

Full Usage: add x l

Parameters:
Returns: DList<'T>
Modifiers: inline
Type parameters: 'T

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

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

ap f x

Full Usage: ap f x

Parameters:
Returns: DList<'b>
Modifiers: inline
f : DList<('a -> 'b)>
x : DList<'a>
Returns: DList<'b>

append left right

Full Usage: append left right

Parameters:
Returns: DList<'T>

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

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

bind m k

Full Usage: bind m k

Parameters:
Returns: DList<'a>
Modifiers: inline
m : DList<'a>
k : 'b -> DList<'a>
Returns: DList<'a>

concat x

Full Usage: concat x

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

cons hd l

Full Usage: cons hd l

Parameters:
Returns: DList<'T>

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

hd : 'T
l : DList<'T>
Returns: DList<'T>

empty

Full Usage: empty

Returns: DList<'T>

O(1). Returns DList of no elements.

Returns: DList<'T>

fold f state l

Full Usage: fold f state l

Parameters:
    f : 'State -> 'T -> 'State
    state : 'State
    l : DList<'T>

Returns: 'State
f : 'State -> 'T -> 'State
state : 'State
l : DList<'T>
Returns: 'State

foldBack f l state

Full Usage: foldBack f l state

Parameters:
    f : 'T -> 'State -> 'State
    l : DList<'T>
    state : 'State

Returns: 'State

O(n). 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 : 'T -> 'State -> 'State
l : DList<'T>
state : 'State
Returns: 'State

head l

Full Usage: head l

Parameters:
Returns: 'T
Modifiers: inline
Type parameters: 'T

O(log n). Returns the first element.

l : DList<'T>
Returns: 'T

isEmpty l

Full Usage: isEmpty l

Parameters:
Returns: bool
Modifiers: inline
Type parameters: 'T

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

l : DList<'T>
Returns: bool

length l

Full Usage: length l

Parameters:
Returns: int
Modifiers: inline
Type parameters: 'T

O(1). Returns the count of elememts.

l : DList<'T>
Returns: int

map f x

Full Usage: map f x

Parameters:
    f : 'a -> 'b
    x : DList<'a>

Returns: DList<'b>
Modifiers: inline
f : 'a -> 'b
x : DList<'a>
Returns: DList<'b>

ofSeq s

Full Usage: ofSeq s

Parameters:
    s : seq<'T>

Returns: DList<'T>

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

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

singleton x

Full Usage: singleton x

Parameters:
    x : 'a

Returns: DList<'a>

O(1). Returns DList of one elements.

x : 'a
Returns: DList<'a>

tail l

Full Usage: tail l

Parameters:
Returns: DList<'T>
Modifiers: inline
Type parameters: 'T

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

l : DList<'T>
Returns: DList<'T>

toList l

Full Usage: toList l

Parameters:
Returns: 'a list
Modifiers: inline

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

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

toSeq l

Full Usage: toSeq l

Parameters:
Returns: seq<'T>
Modifiers: inline
Type parameters: 'T

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

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

tryHead l

Full Usage: tryHead l

Parameters:
Returns: 'T option
Modifiers: inline
Type parameters: 'T

O(log n). Returns option first element.

l : DList<'T>
Returns: 'T option

tryTail l

Full Usage: tryTail l

Parameters:
Returns: DList<'T> option
Modifiers: inline
Type parameters: 'T

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

l : DList<'T>
Returns: DList<'T> option

tryUncons l

Full Usage: tryUncons l

Parameters:
Returns: ('T * DList<'T>) option
Modifiers: inline
Type parameters: 'T

O(log n). Returns option first element and tail.

l : DList<'T>
Returns: ('T * DList<'T>) option

uncons l

Full Usage: uncons l

Parameters:
Returns: 'T * DList<'T>
Modifiers: inline
Type parameters: 'T

O(log n). Returns the first element and tail.

l : DList<'T>
Returns: 'T * DList<'T>