!KH1      !"#$%&'()*+,-./0!An insertion-order-preserving set(C) Richard Cook, 2019MITrcook@rcook.orgstableportableSafe2A]osetAn  behaves much like a 1I but remembers the order in which the elements were originally inserted.oset3A zero-based index with respect to insertion order.oset O(log(N)). Add an element to the left end of the sequence if the set does not already contain the element. Otherwise ignore the element.oset O(log(N))# if the element is not in the set, O(N) if the element is already in the set. Add an element to the left end of the sequence if the set does not already contain the element. Move the element to the left end of the sequence if the element is already present in the set.oset O(log(N))# if the element is not in the set, O(N) if the element is already in the set. Add an element to the right end of the sequence if the set does not already contain the element. Move the element to the right end of the sequence if the element is already present in the set.oset O(log(N)). Add an element to the right end of the sequence if the set does not already contain the element. Otherwise ignore the element.osetO(N^2) worst case. Add elements from the right-hand set to the left-hand set. If elements occur in both sets, then this operation discards elements from the left-hand set and preserves those from the right.oset O(Nlog(N)) worst case. Add elements from the right-hand set to the left-hand set. If elements occur in both sets, then this operation discards elements from the right-hand set and preserves those from the left.oset O(N log(N)). Create a set from a finite list of elements. If an element occurs multiple times in the original list, only the first occurrence is retained in the resulting set. The function 2, O(N), in 3e can be used to return a list of the elements in the original insert order with duplicates removed. osetO(1). The empty set. osetO(1)/. A singleton set containing the given element. osetO(1)$. The number of elements in the set. oset O(log(N))). Determine if the element is in the set. oset O(log(N))-. Determine if the element is not in the set.osetO(N)H. Filter a set by returning a set whose elements satisfy the predicate.oset O(N log(N)). Return the set obtained by applying a function to each element of this set. Note that the resulting set may be smaller than the original. Along with the 4 constraint, this means that  cannot provide a lawful  instance.osetO(1)F. Return ordered sequence of elements in set. For obtaining a useful # instance this is recommended over 2 due to its O(1)> performance. Similarly, if you want to pattern-match on the a, obtain the sequence and use view patterns or pattern synonyms instead of converting to a list.osetO(N)3. Convert the set to an ascending list of elements.osetO(N)Y. Finds the index of the leftmost element that matches the specified element or returns 5% if no matching element can be found.osetO(log(min(i, N - i)))1. Return the element at the specified position, iU, counting from 0. If the specified position is out of range, this function returns 5.osetO(log N)!. Delete an element from the set.osetO(N M). Find the set difference: r \\ s removes all M values in s from r with N values.osetelementosetsetosetsetosetelementosetsetosetsetosetsetosetelementosetsetosetsetosetelementosetsetosetsetosetsetosetsetosetsetosetsetosetsetosetelementsosetset osetset osetelementosetset osetsetosetsize osetelementosetsetoset if element is in set,  otherwise osetelementosetsetoset if element is not in set,  otherwiseoset predicateosetsetosetsetosetfunctionosetsetosetsetosetsetosetsequenceosetsetosetlistosetelementosetsetosetindexosetsetosetindexosetelementosetelementosetsetosetsetosetsetosetsetosetset   555566Type class instances for OSet(C) Richard Cook, 2019MITrcook@rcook.orgstableportableSafe2HposetA right-biased oset the wrapped osetA left-biased  oset the wrapped !osetO(1);. A left-biased singleton set containing the given element."osetO(1)<. A right-biased singleton set containing the given element.!osetelementosetset"osetelementosetset !" !"6      !"##$%%&'()*+,-./0123456789:;<:;=>?@:ABC#oset-0.3.0.0-8KM23fRupez4IMFGn7iCU2Data.Set.OrderedData.Set.Ordered.Instances Data.FunctorFunctor Data.BoolTrueFalseOSetIndex<||<>||><>||<>fromListempty singletonsizemember notMemberfiltermaptoSeq toAscList findIndexelemAtdelete\\$fFoldableOSet $fShowOSet $fDataOSet$fEqOSet $fOrdOSetOSetRunOSetROSetLunOSetL singletonL singletonR $fMonoidOSetL$fSemigroupOSetL$fFoldableOSetL $fShowOSetL $fMonoidOSetR$fSemigroupOSetR$fFoldableOSetR $fShowOSetR $fDataOSetL $fEqOSetL $fOrdOSetL $fDataOSetR $fEqOSetR $fOrdOSetRcontainers-0.6.0.1Data.Set.InternalSetbase Data.FoldabletoListFoldableghc-prim GHC.ClassesOrd GHC.MaybeNothing