Ξυ³h*=τ:Γ—      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–0.1.4?Support functions for dealing with distinct ordered range lists(c) Dylan Simon 2015MIToleg.grenrus@iki.fi experimental#non-portable (tested with GHC only)Safe Œrange-set-list$Determine the number of items in an — range as a ˜range-set-list Determine if [x,y]7 is a subset of the list, returning the list right of y if so.range-set-list6Determine if the first list is a subset of the second.range-set-listAdd [x,y].ΝThere are three possibilities we consider, when inserting into non-empty set:discretely after: continuediscretely before: prependoverlapping: union and prepend™range-set-listAdd [x,y] to the beginning (assuming x <= u).range-set-listUnion two range lists.range-set-list!Remove a range from a range list.ΘThere are 6 possibilities we consider, when deleting from non-empty set:morelessstrictly inside (splits)overlapping less-edgeoverlapping more-edgestricly largeršrange-set-listRemove (,y] while (re-)adding (y,v] if valid›range-set-listRemove (,y]range-set-listΣCompute the set difference, removing each range in the second list from the first.range-set-listCompute the intersection.œrange-set-list(Compute the complement intersected with [x,) assuming x. Find largest element smaller or equal to than the given one.range-set-listO(n)?. Find smallest element greater or equal to than the given one.range-set-listO(n)/. Is the entire range contained within the set?range-set-listO(n+m). Is this a subset? (s1  s2) tells whether s1 is a subset of s2.range-set-listO(1). The empty set.range-set-listO(1). The full set.range-set-listO(1). Create a singleton set.range-set-listO(1). Create a continuos range set.range-set-listO(n). Insert an element in a set.range-set-listO(n)$. Insert a continuos range in a set. range-set-list$/O(n). Delete an element from a set.!range-set-list+/O(n). Delete a continuos range from a set."range-set-listO(n+m). The union of two sets.#range-set-listO(n+m). Difference of two sets.$range-set-listO(n+m). The intersection of two sets.%range-set-listO(n). Complement of the set.&range-set-listO(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.'range-set-listO(n) . Performs a &Λ but also returns whether the pivot element was found in the original set.(range-set-listO(1). The minimal element of a set.)range-set-listO(n). The maximal element of a set.*range-set-listO(n*r). An alias of .-. The elements of a set in ascending order. r is the size of longest range.+range-set-listO(n*r)). Convert the set to a list of elements. r is the size of longest range.,range-set-list O(n*log n)'. Create a set from a list of elements.-range-set-listO(n)1. Create a set from a list of ascending elements. The precondition is not checked. You may use 3 to check the result..range-set-listO(n*r)3. Convert the set to an ascending list of elements./range-set-listO(1)+. Convert the set to a list of range pairs.0range-set-list O(n*log n)*. Create a set from a list of range pairs.1range-set-listO(n*r). Convert the set to a ’ of elements. r is the size of longest range.2range-set-listO(1)Ι. 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 3 on the result.3range-set-listO(n)ρ. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: -, 2' 3 !"#$&'()%*+,-./021' 3 !"#$&'()%*+,-./0219 +Specialization of Data.RangeSet.Map to Ints(c) Dylan Simon, 2015MITSafe7)Σ(;range-set-listΚInternally set is represented as sorted list of distinct inclusive ranges.<range-set-listO(n+m). See Q.=range-set-listO(1). Is this the empty set?>range-set-listO(1). Is this the empty set??range-set-listO(n)(. The number of the elements in the set.@range-set-listO(log n). Is the element in the set?Arange-set-listO(log n) . Is the element not in the set?Brange-set-listO(log n)2. Find largest element smaller than the given one.Crange-set-listO(log n)3. Find smallest element greater than the given one.Drange-set-listO(log n)>. Find largest element smaller or equal to than the given one.Erange-set-listO(log n)?. Find smallest element greater or equal to than the given one.Frange-set-listO(log n)/. Is the entire range contained within the set?Grange-set-listO(n+m). Is this a subset? (s1 G s2) tells whether s1 is a subset of s2.Hrange-set-listO(1). The empty set.Irange-set-listO(1). The full set.Jrange-set-listO(1). Create a singleton set.Krange-set-listO(1). Create a continuos range set.Lrange-set-listO(n). Insert an element in a set.Mrange-set-listO(n)$. Insert a continuos range in a set.Nrange-set-list$/O(n). Delete an element from a set.Orange-set-list+/O(n). Delete a continuos range from a set.Prange-set-listO(n*m). The union of two sets.Qrange-set-listO(n*m). Difference of two sets.Rrange-set-listO(n*m). The intersection of two sets.Srange-set-listO(n). Complement of the set.Trange-set-listO(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.Urange-set-listO(log n) . Performs a TΛ but also returns whether the pivot element was found in the original set.Vrange-set-listO(log n). The minimal element of a set.Wrange-set-listO(log n). The maximal element of a set.Xrange-set-listO(n*r). An alias of \-. The elements of a set in ascending order. r is the size of longest range.Yrange-set-listO(n*r)>. Convert the set to a list of elements (in arbitrary order). r is the size of longest range.Zrange-set-list 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.[range-set-listO(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.\range-set-listO(n*r)3. Convert the set to an ascending list of elements.]range-set-listO(n)+. Convert the set to a list of range pairs.^range-set-list 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._range-set-listO(n). Convert a list-based   to a map-based ;.`range-set-listO(n). Convert a map-based ; to a list-based  .arange-set-listO(n)Θ. 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 b on the result.brange-set-listO(n)ρ. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: [, a(;<=>?@ABCDEFGbHIJKLMNOPQRTUVWSXYZ[\]^_`a(;<=>?@ABCDEFGbHIJKLMNOPQRTUVWSXYZ[\]^_`a<9 4A slightly less trivial implementation of range sets(c) Dylan Simon, 2015MITSafe7:G(irange-set-listΚInternally set is represented as sorted list of distinct inclusive ranges.jrange-set-listO(n+m). See .krange-set-listO(1). Is this the empty set?lrange-set-listO(1). Is this the empty set?mrange-set-listO(n)(. The number of the elements in the set.nrange-set-listO(log n). Is the element in the set?orange-set-listO(log n) . Is the element not in the set?prange-set-listO(log n)2. Find largest element smaller than the given one.qrange-set-listO(log n)3. Find smallest element greater than the given one.rrange-set-listO(log n)>. Find largest element smaller or equal to than the given one.srange-set-listO(log n)?. Find smallest element greater or equal to than the given one.trange-set-listO(log n)/. Is the entire range contained within the set?urange-set-listO(n+m). Is this a subset? (s1 u s2) tells whether s1 is a subset of s2.vrange-set-listO(1). The empty set.wrange-set-listO(1). The full set.xrange-set-listO(1). Create a singleton set.yrange-set-listO(1). Create a continuos range set.zrange-set-listO(n). Insert an element in a set.{range-set-listO(n)$. Insert a continuos range in a set.|range-set-list$/O(n). Delete an element from a set.}range-set-list+/O(n). Delete a continuos range from a set.~range-set-listO(n*m). The union of two sets.range-set-listO(n*m). Difference of two sets.€range-set-listO(n*m). The intersection of two sets.range-set-listO(n). Complement of the set.‚range-set-listO(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.ƒrange-set-listO(log n) . Performs a ‚Λ but also returns whether the pivot element was found in the original set.„range-set-listO(log n). The minimal element of a set.…range-set-listO(log n). The maximal element of a set.†range-set-listO(n*r). An alias of Š,. The elements of a set in ascending order. r is the size of longest range.‡range-set-listO(n*r)>. Convert the set to a list of elements (in arbitrary order). r is the size of longest range.ˆrange-set-list 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.‰range-set-listO(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.Šrange-set-listO(n*r)3. Convert the set to an ascending list of elements.‹range-set-listO(n)+. Convert the set to a list of range pairs.Œrange-set-list 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.range-set-listO(n). Convert a list-based   to a map-based i.Žrange-set-listO(n). Convert a map-based i to a list-based  .range-set-listO(n)Κ. 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.range-set-listO(n)π. Ensure that a set is valid. All functions should return valid sets except those with unchecked preconditions: ‰, (ijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ(ijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽj9 £      !"#$%&'()*+,-./0123456789:;<=>?@A !"#$%&'()*+,-./0123456BC89DEFGHI !"#$%&'()*+,-./0123456BC89:<=>?@JKLJMNOPQRSTUVWXYZΫ+range-set-list-0.1.4-8a6RMnIZiyz3dCrCJGNlAzData.RangeSet.InternalData.RangeSet.ListData.RangeSet.IntMapData.RangeSet.Maprange-set-list 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.EnumEnumData.Semigroup.InternalSumprependRangeListtrimRangeList' trimRangeListcomplementRangeList'complementRangeList'' takeWhileAdjtakeWhileRangeAdjmergeRangeListvalidRangeList'containers-0.6.7Data.Set.InternalSet