FSharpx.Collections


DList

Namespace: FSharpx.Collections
Attributes:
[<RequireQualifiedAccess>]

Functions and values

Function or valueDescription
DList.append arg1 arg2
Signature: DList<'T> -> DList<'T> -> DList<'T>
Type parameters: 'T

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

DList.conj arg1 arg2
Signature: 'T -> DList<'T> -> DList<'T>
Type parameters: 'T

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

DList.cons arg1 arg2
Signature: 'T -> DList<'T> -> DList<'T>
Type parameters: 'T

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

DList.empty
Signature: DList<'T>
Type parameters: 'T Attributes:
[<GeneralizableValue>]

O(1). Returns DList of no elements.

DList.fold arg1 arg2 arg3
Signature: ('State -> 'T -> 'State) -> 'State -> DList<'T> -> 'State
Type parameters: 'State, 'T
DList.foldBack arg1 arg2 arg3
Signature: ('T -> 'State -> 'State) -> DList<'T> -> 'State -> 'State
Type parameters: 'T, '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

DList.head(arg1)
Signature: DList<'T> -> 'T
Type parameters: 'T

O(log n). Returns the first element.

DList.isEmpty(arg1)
Signature: DList<'T> -> bool
Type parameters: 'T

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

DList.length(arg1)
Signature: DList<'T> -> int
Type parameters: 'T

O(1). Returns the count of elememts.

DList.ofSeq(arg1)
Signature: seq<'T> -> DList<'T>
Type parameters: 'T

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

DList.pairwise(arg1)
Signature: DList<'T> -> DList<'T * 'T>
Type parameters: 'T

O(n). Returns a pairwise DList of elements.

DList.singleton(arg1)
Signature: 'T -> DList<'T>
Type parameters: 'T

O(1). Returns DList of one elements.

DList.tail(arg1)
Signature: DList<'T> -> DList<'T>
Type parameters: 'T

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

DList.toList(arg1)
Signature: DList<'T> -> 'T list
Type parameters: 'T

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

DList.toSeq(arg1)
Signature: DList<'T> -> seq<'T>
Type parameters: 'T

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

DList.tryHead(arg1)
Signature: DList<'T> -> 'T option
Type parameters: 'T

O(log n). Returns option first element.

DList.tryTail(arg1)
Signature: DList<'T> -> DList<'T> option
Type parameters: 'T

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

DList.tryUncons(arg1)
Signature: DList<'T> -> ('T * DList<'T>) option
Type parameters: 'T

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

DList.uncons(arg1)
Signature: DList<'T> -> 'T * DList<'T>
Type parameters: 'T

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

Active patterns

Active patternDescription
DList.( |Cons|Nil| )(arg1)
Signature: DList<'T> -> Choice<('T * DList<'T>),unit>
Type parameters: 'T

CompiledName: |Cons|Nil|

Fork me on GitHub