module Data.IntervalMap.Lazy (
I.Interval(..)
, IntervalMap
, (!), (\\)
, null
, size
, member
, notMember
, lookup
, findWithDefault
, lookupLT
, lookupGT
, lookupLE
, lookupGE
, containing
, intersecting
, within
, empty
, singleton
, insert
, insertWith
, insertWithKey
, insertLookupWithKey
, delete
, adjust
, adjustWithKey
, update
, updateWithKey
, updateLookupWithKey
, alter
, union
, unionWith
, unionWithKey
, unions
, unionsWith
, difference
, differenceWith
, differenceWithKey
, intersection
, intersectionWith
, intersectionWithKey
, map
, mapWithKey
, mapAccum
, mapAccumWithKey
, mapAccumRWithKey
, mapKeys
, mapKeysWith
, mapKeysMonotonic
, foldr, foldl
, foldrWithKey, foldlWithKey
, flattenWith
, elems
, keys
, keysSet
, assocs
, toList
, fromList
, fromListWith
, fromListWithKey
, toAscList
, toDescList
, fromAscList
, fromAscListWith
, fromAscListWithKey
, fromDistinctAscList
, filter
, filterWithKey
, partition
, partitionWithKey
, mapMaybe
, mapMaybeWithKey
, mapEither
, mapEitherWithKey
, split
, splitLookup
, splitAt
, splitIntersecting
, isSubmapOf, isSubmapOfBy
, isProperSubmapOf, isProperSubmapOfBy
, findMin
, findMax
, findLast
, lookupMin
, lookupMax
, lookupLast
, deleteMin
, deleteMax
, deleteFindMin
, deleteFindMax
, updateMin
, updateMax
, updateMinWithKey
, updateMaxWithKey
, minView
, maxView
, minViewWithKey
, maxViewWithKey
, valid
, height, maxHeight, showStats
) where
import Prelude hiding (filter, foldl, foldr, lookup, map, null, splitAt)
import Data.IntervalMap.Interval as I
import Data.IntervalMap.Generic.Lazy hiding (IntervalMap, flattenWith)
import qualified Data.IntervalMap.Generic.Lazy as M
type IntervalMap k v = M.IntervalMap (I.Interval k) v
flattenWith :: (Ord k) => (v -> v -> v) -> IntervalMap k v -> IntervalMap k v
flattenWith f m = M.flattenWithMonotonic f' m
where
f' (k1,v1) (k2,v2) = case combine k1 k2 of
Nothing -> Nothing
Just k' -> Just (k', f v1 v2)