Prefix Sharing List
This is an implementation of an immutable List for which append, the non-destructive append operation, takes constant time. There is also a withoutLast operation for producing a list with its rightmost element removed. Iterating over the entire list takes linear time, and does not use recursion.
The implementation should be thread-safe if the lists that are supplied as prefixes are themselves thread-safe. Do not change any of those lists after constructing PrefixSharingLists from them.
Author
Mark van Gulik
Parameters
E
The type of elements in the list.
Types
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard