úÎ7Â5J     &EComplete binary trees. It is not possible to ensure completeness via ' the type system, so make sure you do!  Random-access lists allowing O(1) list operations and O(log n)  indexed access. !"AGenerate a readable error message for out-of-range index access. +Accessed index and list size if available. The error message. O(log n). Retrieve the ith element of the list. Unless   0 <= i < n, an # is raised, see . O(1). Prepend an element to the , see . O(n) where n, is the size of the first list. Appends two  s, see . O(1). Builds an empty . O(1). Builds a singleton . O(n).  n x constructs a  that  contains the same element x n times. O(1) . Is the  empty? O(1) . Is the  empty? O(1)(. The number of elements contained in a . O(n)'. Is the given element a member of the ? O(n);. Find the index of a given element. If the element is not  a member of the , this function will $ or  % index otherwise. &'Find the index of a given element in a  . Returns '  index on success and ( on failure. O(1). Returns the head of a . O(1). Retrieve the tail of a . O(1). Retrieve both,   and   of a . O(1). Prepend an element to the . O(n) where n is the  ' of the first list. Appends the second  list to the first list.  O(max(n, m)) . List-like ). This function is faster  when called with two s of equal size.  O(max(n, m)) . List-like *. This function is faster  when called with two s of equal size. + Performs  for complete binary trees. O(log n). Retrieve the ith element of the list. Unless   0 <= i < n, an # is raised. O(log n) . Set the ith element of the list. Unless   0 <= i < n, an # is raised. O(log n) . Adjust i(th element of the list according to the  given function. Unless  0 <= i < n, an # is raised. O(log n) . Find the i+th element of the list and change it. This / function returns the element that is at index i in the original   and a new  with the ith 3 element replaced according to the given function:   D lookup index list === fst (adjustLookup undefined index list) D adjust f index list === snd (adjustLookup f index list) Unless  0 <= i < n, an # is raised. Modifying element function. Index of the affected element.  to be modified. Original element and modified . , Performs ) on a complete binary tree. Note that it  is crucial, that the  really is complete! $Function to change a given element. "Size of the complete binary tree. Index to be replaced.  The tree. O(n) . Build a  from a list. O(n) . Convert a  to a list. O(n) . Convert a " to a list of tuples each holding G an element and its index. The list is ordered ascending regarding the  indices. O(n) . Build a - from a . The keys in the  -( are the indices of the elements in the . O(n) . Build an . from a . The keys in the  .( are the indices of the elements in the . O(n) . Given an / , generate a . The elements'  order will be preserved. O(n) . Build an / from the . It will have  an index range from  [0 .. n-1], where n is the s   .    0      !"#$%&$'($')*$+,$+-$.$./01231456789random-access-list-0.1Data.RandomAccessListRandomAccessList.!..:..+.empty singleton replicatenullisEmptysizememberindexheadtail extractHeadconsappendzipzipWithlookupupdateadjust adjustLookupfromListtoList toIndexedListtoMaptoIntMap fromArraytoArrayCBTreeNodeLeafindexErrorMessagebaseGHC.ErrerrorGHC.Basefailreturn indexTree Data.MaybeJustNothingGHC.List zipWithTreeadjustLookupTreecontainers-0.3.0.0Data.MapMap Data.IntMapIntMap array-0.3.0.1Data.Array.BaseIArray