fsprojects/FSharpx.Collections


DList

Namespace: FSharpx.Collections.Experimental

Functions and values

Function or valueDescription
append left right
Signature: left:DList<'?13718> -> right:DList<'?13718> -> DList<'?13718>
Type parameters: '?13718

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

cons hd tl
Signature: hd:'?13716 -> tl:DList<'?13716> -> DList<'?13716>
Type parameters: '?13716

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

empty
Signature: DList<'T>
Type parameters: 'T

O(1). Returns DList of no elements.

fold f seed l
Signature: f:('?13726 -> '?13727 -> '?13726) -> seed:'?13726 -> l:DList<'?13727> -> '?13726
Type parameters: '?13726, '?13727

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

head l
Signature: l:DList<'?13720> -> '?13720
Type parameters: '?13720

O(log n). Returns the first element.

isEmpty l
Signature: l:DList<'?13706> -> bool
Type parameters: '?13706

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

length l
Signature: l:DList<'?13708> -> int
Type parameters: '?13708

O(1). Returns the count of elememts.

ofSeq s
Signature: s:seq<'?13712> -> DList<'?13712>
Type parameters: '?13712

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

singleton x
Signature: x:'?13710 -> DList<'?13710>
Type parameters: '?13710

O(1). Returns DList of one elements.

snoc l x
Signature: l:DList<'?13722> -> x:'?13722 -> DList<'?13722>
Type parameters: '?13722

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

tail l
Signature: l:DList<'?13724> -> DList<'?13724>
Type parameters: '?13724

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

toArray l
Signature: l:DList<'?13731> -> '?13731 []
Type parameters: '?13731
toList l
Signature: l:DList<'?13729> -> '?13729 list
Type parameters: '?13729
toSeq l
Signature: l:DList<'?13714> -> seq<'?13714>
Type parameters: '?13714

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

Fork me on GitHub