Module im::conslist [] [src]

Cons List

An implementation of immutable proper cons lists.

Structure can be shared between lists (and is reference counted), and append to the front of a list is O(1). Cons cells keep track of the length of the list at the current position, as an extra optimisation, so getting the length of a list is also O(1). Otherwise, operations are generally O(n).

Unless you know you want a ConsList, you might be better off using a List, which has more generically efficient performance characteristics, but which is outperformed by the ConsList if you're usually only operating on the front of the list.

Structs

ConsList

An implementation of immutable proper cons lists.

Iter

Functions

cons

Prepend a value to a list.