!OL6      !"#$%&'()*+,-./0123455Type classes defining standard ordered-set operations(C) Richard Cook, 2019MITrcook@rcook.orgstableportableSafe@ABoset and p operations that preserve elements from the right-hand operand in the case of duplicate elements. Set type is c, element type is a.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 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.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 and o operations that preserve elements from the left-hand operand in the case of duplicate elements. Set type is c, element type is a.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)). Add an element to the right end of the sequence if the set does not already contain the element. Otherwise ignore the element.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/Common operations on ordered sets. Set type is c, element type is a. osetO(1). The empty set. osetO(1)/. A singleton set containing the given element. 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  , O(N)f, can be used to return a list of the elements in the original insert order with duplicates removed. 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 last occurrence is retained in the resulting set. The function  , O(N)f, can be used to return a list of the elements in the original insert order with duplicates removed. oset O(log(N))7. Determine if the element is in the set. Evaluate to    if element is in set,    otherwise.oset O(log(N));. Determine if the element is not in the set. Evaluate to    if element is not in set,    otherwise.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 6 constraint, this means that OSet cannot provide a lawful   instance.osetO(N)H. Filter a set by returning a set whose elements satisfy the predicate.osetO(1)$. The number of elements in the set.osetO(1)F. Return ordered sequence of elements in set. For obtaining a useful  $ instance this is recommended over   due to its O(1)> performance. Similarly, if you want to pattern-match on the OSeta, 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 Nothing& 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 Nothing.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.oset3A zero-based index with respect to insertion order.      556556!An insertion-order-preserving set(C) Richard Cook, 2019MITrcook@rcook.orgstableportableSafe2=?@AFosetAn  behaves much like a 7I but remembers the order in which the elements were originally inserted.     $Left- and right-biased wrappers for OSet(C) Richard Cook, 2019MITrcook@rcook.orgstableportableNone12=?@AMJ0"osetA right-biased .#osetA left-biased ."##"!An insertion-order-preserving set(C) Richard Cook, 2019MITrcook@rcook.orgstableportableNoneK  "##"   8 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH#oset-0.4.0.0-Hi9biOEXDqhKwztQAeO9xEData.Set.Ordered.ClassesData.Set.Ordered.OSetData.Set.Ordered.LRData.Set.OrderedOSetOSetROSetLData.Foldable.FoldabletoList Data.BoolTrueFalse Data.FunctorFunctor PreserveR<|>|<>| PreserveL|<|>|<> OrderedSetempty singleton fromListL fromListRmember notMembermapfiltersizetoSeq toAscList findIndexelemAtdelete\\Index$fPreserveRaOSet$fPreserveLaOSet$fOrderedSetaOSet$fFoldableOSet $fShowOSet $fDataOSet$fEqOSet $fOrdOSet $fMonoidOSetL$fSemigroupOSetL $fShowOSetL $fMonoidOSetR$fSemigroupOSetR $fShowOSetR $fDataOSetL $fEqOSetL$fFoldableOSetL $fOrdOSetL $fDataOSetR $fEqOSetR$fFoldableOSetR $fOrdOSetR$fPreserveROSetR$fOrderedSetOSetR$fPreserveLOSetL$fOrderedSetOSetLghc-prim GHC.ClassesOrdcontainers-0.6.0.1Data.Set.InternalSet