Collections.TreequenceSourceA Treequence is an implementation `Dlist` which keeps its elements in a tree. Every operation that adds elements to Treequence is O(1). Operations that retrieve or remove elements from it will restructure the tree to expose either the front or back of the list for fast access. This allows for efficient accesses on both ends but there is a cost to be paid when switching between accessing from the front/back or the back.
include Dlist_itf.SA 'a t is a Dlist containing elements of type 'a. A Dlist, short for double-ended list, is a purely functional ordered list of elements that can be accessed both from the front and the back.
A name for the datatype, there are different implementations of this interface, you can check this name to identify which implementation you are using.
map f t applies a function to each element of t, creating a new Dlist with the results.
append s1 s2 Creates Dlist that contains all elements of s1 followed by all elements of s2.
of_list elements Creates a Dlist from the elements of the list. The front of the list will become the front ot the Dlist. The first element you pop from the Dlist will be the first element in the list.
Converts Dlist into a string revealing its internal structure. Useful for debugging and testing.
get i s finds element at index i from the front. For example get 0 s is equivalent pop s