úÎÝ:ÕSp      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoportable experimentalchris@chr-breitkopf.de!Intervals with endpoints of type a. p and q; use mathematical notation with square brackets for closed  and parens for open intervals. N This is better for human readability, but is not a valid Haskell expression. F Closed intervals look like a list, open intervals look like a tuple, 6 and half-open intervals look like mismatched parens. 'Excluding lower bound, including upper Open at both ends Closed at both ends 'Including lower bound, excluding upper rsLike t), but considering the upper bound first. Get the lower bound. Get the upper bound. Is the interval empty? +Does the interval include its lower bound? +Does the interval include its upper bound? Do the two intervals overlap? 7Does the first interval completely contain the second? "Interval strictly before another? W True if the upper bound of the first interval is below the lower bound of the second. !Interval strictly after another?  Same as ' flip before'. )Does the interval contain a given point? +Is a point strictly less than lower bound? .Is a point strictly greater than upper bound?     portable experimentalchbreitkopf@googlemail.com}uvw,A map from intervals with endpoints of type k to values of type v. xyz{|O(log n)$. Lookup value for given key. Calls } if the key is not in the map. Same as I. ~€‚ƒO(1). The empty map. O(1). A map with one entry. O(1). Is the map empty? O(n). Number of keys in the map. #The height of the tree. For testing/debugging only. GThe maximum height of a red-black tree with the given number of nodes. /Tree statistics (size, height, maxHeight size) O(log n)/. Does the map contain the given key? See also . O(log n)3. Does the map not contain the given key? See also . O(log n)8. Look up the given key in the map, returning the value („ value),  or … if the key is not in the map. O(log n). The expression ( def k map) returns  the value at key k or returns default value def ! when the key is not in the map. < findWithDefault 'x' 1 (fromList [(5,'a'), (3,'b')]) == 'x' < findWithDefault 'x' 5 (fromList [(5,'a'), (3,'b')]) == 'a' Return all key/=value pairs where the key intervals contain the given point. 3 The elements are returned in ascending key order. O(n)6, since potentially all keys could contain the point.  O(log n)T average case. This is also the worst case for maps containing no overlapping keys. !Return all key/Lvalue pairs where the key intervals overlap (intersect) the given interval. 3 The elements are returned in ascending key order. O(n);, since potentially all keys could intersect the interval.  O(log n)3 average case, if few keys intersect the interval. "Return all key/Nvalue pairs where the key intervals are completely inside the given interval. 3 The elements are returned in ascending key order. O(n);, since potentially all keys could be inside the interval.  O(log n)4 average case, if few keys are inside the interval. #O(log n). Insert a new key/>value pair. If the map already contains the key, its value is  changed to the new value. $O(log n)=. Insert with a function, combining new value and old value.  $ f key value mp ( will insert the pair (key, value) into mp if key does @ not exist in the map. If the key does exist, the function will  insert the pair (key, f new_value old_value). %Same as $2, but the combining function is applied strictly. , This is often the most desirable behavior. &O(log n)B. Insert with a function, combining key, new value and old value.  & f key value mp ( will insert the pair (key, value) into mp if key does @ not exist in the map. If the key does exist, the function will  insert the pair (key,f key new_value old_value). 9 Note that the key passed to f is the same key passed to &. 'Same as &2, but the combining function is applied strictly. (O(log n),. Combine insert with old values retrieval. )O(log n). A strict version of (. †‡*O(log n)5. Returns the smallest key and its associated value.  Calls } if the map is empty. +O(log n)4. Returns the largest key and its associated value.  Calls } if the map is empty. ,0Returns the interval with the largest endpoint. 8 If there is more than one interval with that endpoint,  return the rightmost. O(n)/, since all keys could have the same endpoint.  O(log n) average case. -O(log n)R. Remove the smallest key from the map. Return the empty map if the map is empty. ˆ‰Š‹.O(log n)Q. Remove the largest key from the map. Return the empty map if the map is empty. /O(log n)&. Delete and return the smallest key. 0O(log n)%. Delete and return the largest key. 1O(log n)). Update or delete value at minimum key. 2O(log n)). Update or delete value at maximum key. 3O(log n)). Update or delete value at minimum key. 4O(log n)). Update or delete value at maximum key. Œ5O(n)?. Fold the values in the map using the given right-associative  binary operator, such that 5 f z ==  Prelude.foldr f z . Y. 6O(n). A strict version of 5&. Each application of the operator is A evaluated before using the result in the next application. This + function is strict in the starting value. 7O(n)>. Fold the values in the map using the given left-associative  binary operator, such that 7 f z ==  Prelude.foldl f z . Y. 8O(n). A strict version of 7&. Each application of the operator is A evaluated before using the result in the next application. This + function is strict in the starting value. 9O(n)H. Fold the keys and values in the map using the given right-associative  binary operator, such that  9 f z ==  Prelude.foldr (Ž f) z . O. :O(n). A strict version of 9&. Each application of the operator is A evaluated before using the result in the next application. This + function is strict in the starting value. ;O(n)G. Fold the keys and values in the map using the given left-associative  binary operator, such that  ; f z ==  Prelude.foldl (\z' (kx, x) -> f z' kx x) z . O. <O(n). A strict version of ;&. Each application of the operator is A evaluated before using the result in the next application. This + function is strict in the starting value. =O(log n)B. Delete a key from the map. If the map does not contain the key,  it is returned unchanged. >O(log n)M. Update a value at a specific key with the result of the provided function.  When the key is not 4 a member of the map, the original map is returned. ?O(log n)8. Adjust a value at a specific key. When the key is not 4 a member of the map, the original map is returned. @O(log n). The expression (@ f k map) updates the value x  at k (if it is in the map). If (f x) is …, the element is  deleted. If it is („ y ), the key k is bound to the new value y. AO(log n). The expression (A f k map) updates the  value x at k (if it is in the map). If (f k x) is …, # the element is deleted. If it is („ y ), the key k is bound  to the new value y. BO(log n). Lookup and update. See also A. 7 The function returns changed value, if it is updated. = Returns the original key value if the map entry is deleted. CO(log n). The expression (C f k map) alters the value x at k, or absence thereof.  C7 can be used to insert, delete, or update a value in a Map.  In short :  k (C f k m) = f ( k m). DO(n+m). The expression (D t1 t2!) takes the left-biased union of t1 and t2.  It prefers t1& when duplicate keys are encountered,  i.e. (D == E ‘). EO(n+m)#. Union with a combining function. FO(n+m)#. Union with a combining function. GThe union of a list of maps:  (G ==  Prelude.foldl D ). H9The union of a list of maps, with a combining operation:  (H f ==  Prelude.foldl (E f) ). IO(n+m). Difference of two maps. B Return elements of the first map not existing in the second map. JO(n+m)). Difference with a combining function.  When two equal keys are M encountered, the combining function is applied to the values of these keys.  If it returns …7, the element is discarded (proper set difference). If  it returns („ y+), the element is updated with a new value y. KO(n+m)@. Difference with a combining function. When two equal keys are L encountered, the combining function is applied to the key and both values.  If it returns …7, the element is discarded (proper set difference). If  it returns („ y+), the element is updated with a new value y. LO(n+m). Intersection of two maps. B Return data in the first map for the keys existing in both maps.  (L m1 m2 == M ‘ m1 m2). MO(n+m)*. Intersection with a combining function. NO(n+m)*. Intersection with a combining function. ’“”OO(n). The list of all key/>value pairs contained in the map, in ascending order of keys. PO(n). The list of all key/:value pairs contained in the map, in no particular order. QO(n). The list of all key/?value pairs contained in the map, in descending order of keys. R O(n log n) . Build a map from a list of key/value pairs. See also U. K If the list contains more than one value for the same key, the last value  for the key is retained. S O(n log n) . Build a map from a list of key/0value pairs with a combining function. See also V. T O(n log n) . Build a map from a list of key/0value pairs with a combining function. See also V. UO(n)5. Build a map from an ascending list in linear time.  :The precondition (input list is ascending) is not checked. VO(n)^. Build a map from an ascending list in linear time with a combining function for equal keys.  :The precondition (input list is ascending) is not checked. WO(n)^. Build a map from an ascending list in linear time with a combining function for equal keys.  :The precondition (input list is ascending) is not checked. •XO(n)T. Build a map from an ascending list of elements with distinct keys in linear time.   The precondition is not checked. –—YO(n)C. List of all values in the map, in ascending order of their keys. ZO(n)3. List of all keys in the map, in ascending order. [O(n). Set of the keys. \Same as O. ]O(n)-. Map a function over all values in the map. ^O(n)-. Map a function over all values in the map. _O(n). The function _ threads an accumulating 6 argument through the map in ascending order of keys.  let f a b = (a ++ b, b ++ "X") p mapAccum f "Everything: " (fromList [(5,"a"), (3,"b")]) == ("Everything: ba", fromList [(3, "bX"), (5, "aX")]) `O(n). The function ` threads an accumulating 6 argument through the map in ascending order of keys. < let f a k b = (a ++ " " ++ (show k) ++ "-" ++ b, b ++ "X") { mapAccumWithKey f "Everything:" (fromList [(5,"a"), (3,"b")]) == ("Everything: 3-b 5-a", fromList [(3, "bX"), (5, "aX")]) ˜O(n). The function ˜ threads an accumulating 7 argument throught the map in ascending order of keys. aO(n). The function  mapAccumR threads an accumulating 7 argument through the map in descending order of keys. b O(n log n). b f s! is the map obtained by applying f to each key of s. )The size of the result may be smaller if f maps two or more distinct F keys to the same new key. In this case the value at the smallest of  these keys is retained. c O(n log n). c c f s! is the map obtained by applying f to each key of s. )The size of the result may be smaller if f maps two or more distinct G keys to the same new key. In this case the associated values will be  combined using c. d O(n log n). d f s == b f s, but works only when f  is strictly monotonic.  That is, for any values x and y, if x < y then f x < f y.   The precondition is not checked. (This function is currently identical to b2, but will eventually be rewritten to have better  better performance (O(n)). eO(n)(. Filter values satisfying a predicate. fO(n) . Filter keys/values satisfying a predicate. gO(n)8. Partition the map according to a predicate. The first F map contains all elements that satisfy the predicate, the second all , elements that fail the predicate. See also m. hO(n)8. Partition the map according to a predicate. The first F map contains all elements that satisfy the predicate, the second all , elements that fail the predicate. See also m. iO(n). Map values and collect the „ results. jO(n) . Map keys/values and collect the „ results. kO(n). Map values and separate the ™ and š results. lO(n) . Map keys/values and separate the ™ and š results. mO(n). The expression (m k map ) is a pair  (map1,map2) where  the keys in map1 are smaller than k and the keys in map2 larger than k.  Any key equal to k is found in neither map1 nor map2. nO(n). The expression (n k map) splits a map just  like m but also returns  k map!. oBCheck red-black-tree and interval search augmentation invariants. c !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoc !"#$%&'()=>?@ABCDEFGHIJKLMN]^_`abcd579;86:<YZ[\PRSTOQUVWXefghijklmn*+,-./01234o^ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno›      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstusvwxysz{|}~€‚ƒs„…†‡ˆ‰Š‹sŒsŒŽ‘’“”•–s—˜™šs›œžŸ ¡¢£s¤¥s¤¦§IntervalMap-0.2.1Data.IntervalMap.IntervalData.IntervalMapInterval IntervalOC OpenIntervalClosedInterval IntervalCOcompareByUpper lowerBound upperBoundisEmpty leftClosed rightClosedoverlapssubsumesbeforeafterinsidebelowabove IntervalMap!\\empty singletonnullsizeheight maxHeight showStatsmember notMemberlookupfindWithDefault containing intersectingwithininsert insertWith insertWith' insertWithKeyinsertWithKey'insertLookupWithKeyinsertLookupWithKey'findMinfindMaxfindLast deleteMin deleteMax deleteFindMin deleteFindMax updateMin updateMaxupdateMinWithKeyupdateMaxWithKeyfoldrfoldr'foldlfoldl' foldrWithKey foldrWithKey' foldlWithKey foldlWithKey'deleteadjust adjustWithKeyupdate updateWithKeyupdateLookupWithKeyalterunion unionWith unionWithKeyunions unionsWith differencedifferenceWithdifferenceWithKey intersectionintersectionWithintersectionWithKey toAscListtoList toDescListfromList fromListWithfromListWithKey fromAscListfromAscListWithfromAscListWithKeyfromDistinctAscListelemskeyskeysSetassocsmap mapWithKeymapAccummapAccumWithKeymapAccumRWithKeymapKeys mapKeysWithmapKeysMonotonicfilter filterWithKey partitionpartitionWithKeymapMaybemapMaybeWithKey mapEithermapEitherWithKeysplit splitLookupvalidbaseGHC.ReadReadGHC.ShowShowcompareLcompareU GHC.Classescompare DeleteResultShrunk UnchangedNodeNilColorBRGHC.ErrerrorisRed turnBlackturnRedmNodemaxUpper maxByUpper Data.MaybeJustNothingbalanceLbalanceR deleteMin' deleteMax' unbalancedR unbalancedL setMinValue setMaxValue Data.Tupleuncurrydelete'blackifyGHC.Baseconst ascListUnionascListDifferenceascListIntersection combineEq isPerfectlog2 mapAccumL Data.EitherLeftRight