FSharpx.Collections


DList<'T> Type

The DList is an implementation of John Hughes' append list. See http://dl.acm.org/citation.cfm?id=8475 for more information. This implementation adds an additional parameter to allow a more efficient calculation of the list length. Note that an alternate form would represent the DList as: type DList<'T> = DList of ('T list -> 'T list) An example can be found at http://stackoverflow.com/questions/5324623/functional-o1-append-and-on-iteration-from-first-element-list-data-structure/5327209#5327209

Union cases

Union case Description

Join(DList<'T>, DList<'T>, int)

Full Usage: Join(DList<'T>, DList<'T>, int)

Parameters:
Item1 : DList<'T>
Item2 : DList<'T>
Item3 : int

Nil

Full Usage: Nil

Unit 'T

Full Usage: Unit 'T

Parameters:
    Item : 'T

Item : 'T

Instance members

Instance member Description

this.Head

Full Usage: this.Head

Returns: 'T

O(log n). Returns the first element.

Returns: 'T

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

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

Returns: bool

this.Length

Full Usage: this.Length

Returns: int

O(1). Returns the count of elements.

Returns: int

this.Tail

Full Usage: this.Tail

Returns: DList<'T>

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

Returns: DList<'T>

this.snoc a

Full Usage: this.snoc a

Parameters:
    a : 'T

Returns: DList<'T>

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

a : 'T
Returns: DList<'T>

Static members

Static member Description

left = right

Full Usage: left = right

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

([])()

Full Usage: ([])()

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