úΡqŽU—      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–?Support functions for dealing with distinct ordered range lists(c) Dylan Simon 2015MIToleg.grenrus@iki.fi experimental#non-portable (tested with GHC only)Safe#)$Determine the number of items in an — range as a ˜ Determine if [x,y]7 is a subset of the list, returning the list right of y if so.6Determine if the first list is a subset of the second.Add [x,y].MThere are three possibilities we consider, when inserting into non-empty set:discretely after: continuediscretely before: prependoverlapping: union and prepend™Add [x,y] to the beginning (assuming x <= u).Union two range lists.!Remove a range from a range list.HThere are 6 possibilities we consider, when deleting from non-empty set:morelessstrictly inside (splits)overlapping less-edgeoverlapping more-edgestricly largeršRemove (,y] while (re-)adding (y,v] if valid›Remove (,y]SCompute the set difference, removing each range in the second list from the first.Compute the intersection.œ(Compute the complement intersected with [x,) assuming x<u.(Compute the complement intersected with (x,).Compute the complement.ž–Take elements off the beginning of the list while they are equal or adjacent to the given item, and return the last removed item and remaining list.ŸÁTake ranges off the beginning of a unnormalized but sorted and valid range list while they are overlapping or adjacent to the given value, and return the last removed item and remaining list. 4Normalize a sorted list of elements to a range list. 8Normalize an arbitrary list of elements to a range list. (Normalize a sorted list of valid ranges. &Normalize an arbitrary list of ranges.Ą1Check if a list is normalized and strictly above b. Check if a list is normalized.   &A trivial implementation of range sets(c) Oleg Grenrus 2014MIToleg.grenrus@iki.fi experimental#non-portable (tested with GHC only)Safe1K' JInternally set is represented as sorted list of distinct inclusive ranges.O(n+m). See #.O(1). Is this the empty set?O(1). Is this the full set?O(n)(. The number of the elements in the set.O(n). Is the element in the set?O(n) . Is the element not in the set?O(n)2. Find largest element smaller than the given one.O(n)3. Find smallest element greater than the given one.O(n)>. Find largest element smaller or equal to than the given one.O(n)?. Find smallest element greater or equal to than the given one.O(n)/. Is the entire range contained within the set?O(n+m). Is this a subset? (s1  s2) tells whether s1 is a subset of s2.O(1). The empty set.O(1). The full set.O(1). Create a singleton set.O(1). Create a continuos range set.O(n). Insert an element in a set.O(n)$. Insert a continuos range in a set. $/O(n). Delete an element from a set.!+/O(n). Delete a continuos range from a set."O(n+m). The union of two sets.#O(n+m). Difference of two sets.$O(n+m). The intersection of two sets.%O(n). Complement of the set.&O(n). The expression (& x set ) is a pair  (set1,set2) where set1 comprises the elements of set less than x and set2 comprises the elements of set greater than x.'O(n) . Performs a &K but also returns whether the pivot element was found in the original set.(O(1). The minimal element of a set.)O(n). The maximal element of a set.*O(n*r). An alias of .-. The elements of a set in ascending order. r is the size of longest range.+O(n*r)). Convert the set to a list of elements. r is the size of longest range., O(n*log n)'. Create a set from a list of elements.-O(n)1. Create a set from a list of ascending elements. The precondition is not checked. You may use 3 to check the result..O(n*r)3. Convert the set to an ascending list of elements./O(1)+. Convert the set to a list of range pairs.0 O(n*log n)*. Create a set from a list of range pairs.1O(n*r). Convert the set to a ĸ of elements. r is the size of longest range.2O(1)I. Convert a normalized, non-adjacent, ascending list of ranges to a set. The precondition is not checked.A In general you should only use this function on the result of / or ensure 3 on the result.3O(n)q. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: -, 2'  !"#$%&'()*+,-./0123' 3 !"#$&'()%*+,-./021 Ŗ9 +Specialization of Data.RangeSet.Map to Ints(c) Dylan Simon, 2015MITSafe1{ø(;JInternally set is represented as sorted list of distinct inclusive ranges.<O(n+m). See Q.=O(1). Is this the empty set?>O(1). Is this the empty set??O(n)(. The number of the elements in the set.@O(log n). Is the element in the set?AO(log n) . Is the element not in the set?BO(log n)2. Find largest element smaller than the given one.CO(log n)3. Find smallest element greater than the given one.DO(log n)>. Find largest element smaller or equal to than the given one.EO(log n)?. Find smallest element greater or equal to than the given one.FO(log n)/. Is the entire range contained within the set?GO(n+m). Is this a subset? (s1 G s2) tells whether s1 is a subset of s2.HO(1). The empty set.IO(1). The full set.JO(1). Create a singleton set.KO(1). Create a continuos range set.LO(n). Insert an element in a set.MO(n)$. Insert a continuos range in a set.N$/O(n). Delete an element from a set.O+/O(n). Delete a continuos range from a set.PO(n*m). The union of two sets.QO(n*m). Difference of two sets.RO(n*m). The intersection of two sets.SO(n). Complement of the set.TO(log n). The expression (T x set ) is a pair  (set1,set2) where set1 comprises the elements of set less than x and set2 comprises the elements of set greater than x.UO(log n) . Performs a TK but also returns whether the pivot element was found in the original set.VO(log n). The minimal element of a set.WO(log n). The maximal element of a set.XO(n*r). An alias of \-. The elements of a set in ascending order. r is the size of longest range.YO(n*r)>. Convert the set to a list of elements (in arbitrary order). r is the size of longest range.Z O(n*log n)'. Create a set from a list of elements.Note that unlike Data.Set‹ and other binary trees, this always requires a full sort and traversal to create distinct, disjoint ranges before constructing the tree.[O(n)1. Create a set from a list of ascending elements. The precondition is not checked. You may use b( to check the result. Note that unlike Data.Set‚ and other binary trees, this always requires a full traversal to create distinct, disjoint ranges before constructing the tree.\O(n*r)3. Convert the set to an ascending list of elements.]O(n)+. Convert the set to a list of range pairs.^ O(n*log n)*. Create a set from a list of range pairs.Note that unlike Data.Set‹ and other binary trees, this always requires a full sort and traversal to create distinct, disjoint ranges before constructing the tree._O(n). Convert a list-based   to a map-based ;.`O(n). Convert a map-based ; to a list-based  .aO(n)H. Convert a normalized, non-adjacent, ascending list of ranges to a set. The precondition is not checked.A In general you should only use this function on the result of ] or ensure b on the result.bO(n)q. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: [, a(;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab(;<=>?@ABCDEFGbHIJKLMNOPQRTUVWSXYZ[\]^_`a;¤<9 4A slightly less trivial implementation of range sets(c) Dylan Simon, 2015MITSafe1Ŧķ(iJInternally set is represented as sorted list of distinct inclusive ranges.jO(n+m). See .kO(1). Is this the empty set?lO(1). Is this the empty set?mO(n)(. The number of the elements in the set.nO(log n). Is the element in the set?oO(log n) . Is the element not in the set?pO(log n)2. Find largest element smaller than the given one.qO(log n)3. Find smallest element greater than the given one.rO(log n)>. Find largest element smaller or equal to than the given one.sO(log n)?. Find smallest element greater or equal to than the given one.tO(log n)/. Is the entire range contained within the set?uO(n+m). Is this a subset? (s1 u s2) tells whether s1 is a subset of s2.vO(1). The empty set.wO(1). The full set.xO(1). Create a singleton set.yO(1). Create a continuos range set.zO(n). Insert an element in a set.{O(n)$. Insert a continuos range in a set.|$/O(n). Delete an element from a set.}+/O(n). Delete a continuos range from a set.~O(n*m). The union of two sets.O(n*m). Difference of two sets.€O(n*m). The intersection of two sets.O(n). Complement of the set.‚O(log n). The expression (‚ x set ) is a pair  (set1,set2) where set1 comprises the elements of set less than x and set2 comprises the elements of set greater than x.ƒO(log n) . Performs a ‚K but also returns whether the pivot element was found in the original set.„O(log n). The minimal element of a set.…O(log n). The maximal element of a set.†O(n*r). An alias of Š,. The elements of a set in ascending order. r is the size of longest range.‡O(n*r)>. Convert the set to a list of elements (in arbitrary order). r is the size of longest range.ˆ O(n*log n):. Create a set from a list of elements. Note that unlike Data.Set‰ and other binary trees, this always requires a full sort and traversal to create distinct, disjoint ranges before constructing the tree.‰O(n)3. Create a set from a list of ascending elements.  The precondition is not checked. You may use ( to check the result. Note that unlike Data.Set€ and other binary trees, this always requires a full traversal to create distinct, disjoint ranges before constructing the tree.ŠO(n*r)3. Convert the set to an ascending list of elements.‹O(n)+. Convert the set to a list of range pairs.Œ O(n*log n)=. Create a set from a list of range pairs. Note that unlike Data.Set‰ and other binary trees, this always requires a full sort and traversal to create distinct, disjoint ranges before constructing the tree.O(n). Convert a list-based   to a map-based i.ŽO(n). Convert a map-based i to a list-based  .O(n)J. Convert a normalized, non-adjacent, ascending list of ranges to a set.  The precondition is not checked.@ In general you should only use this function on the result of ‹ or ensure  on the result.O(n)p. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: ‰, (ijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ(ijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽiĨj9 Ļ      !"#$%&'()*+,-./0123456789:;<=>?@ !"#$%&'()*+,-./012345AB78CDEFGH !"#$%&'()*+,-./012345AB789;<=>?IJKILMNOPQRSTUVWXYZ+range-set-list-0.1.3-7EKguv9vk8MEntho1hKmC3Data.RangeSet.InternalData.RangeSet.ListData.RangeSet.IntMapData.RangeSet.Map rangeSizerangeIsSubsetListisSubsetRangeListinsertRangeListunionRangeListdeleteRangeListdifferenceRangeListintersectRangeListcomplementRangeListfromAscElemList fromElemListnormalizeRangeListvalidRangeListRSet\\nullisFullsizemember notMemberlookupLTlookupGTlookupLElookupGE containsRange isSubsetOfemptyfull singletonsingletonRangeinsert insertRangedelete deleteRangeunion difference intersection complementsplit splitMemberfindMinfindMaxelemstoListfromList fromAscList toAscList toRangeList fromRangeListtoSetfromNormalizedRangeListvalid $fNFDataRSet$fHashableRSet $fMonoidRSet$fSemigroupRSet $fShowRSet$fEqRSet $fOrdRSetRIntSet fromRListtoRList$fNFDataRIntSet$fMonoidRIntSet$fSemigroupRIntSet $fShowRIntSet $fEqRIntSet $fOrdRIntSetbaseGHC.EnumEnum Data.MonoidSumprependRangeListtrimRangeList' trimRangeListcomplementRangeList'complementRangeList'' takeWhileAdjtakeWhileRangeAdjmergeRangeListvalidRangeList'containers-0.5.10.2Data.Set.InternalSet