HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulefingertree-0.1.6.2Haskell2010

Data.IntervalMap.FingerTree

Interval maps implemented using the FingerTree type, following section 4.8 of

An amortized running time is given for each operation, with n referring to the size of the priority queue. These bounds hold even in a persistent (shared) setting.

Note: Many of these operations have the same names as similar operations on lists in the Prelude. The ambiguity may be resolved using either qualification or the hiding clause.

  • 2 types
  • 13 values
  • Packagefingertree-0.1.6.2
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFingerTree.hs

Intervals

4 declarations
datadata Interval v
#

A closed interval. The lower bound should be less than or equal to the upper bound.

Constructors

  • Interval v v

    Lower and upper bounds of the interval.

Instances7Eq, Ord, Read, Show, Generic, NFData, …
valuelow :: Interval v -> v
#

Lower bound of the interval

valuepoint :: v -> Interval v
#

An interval in which the lower and upper bounds are equal.

Interval maps

5 declarations
newtypenewtype IntervalMap v a
#

Map of closed intervals, possibly with duplicates.

Instances11Functor, Foldable, Traversable, Eq, Ord, Show, …
valueinsert :: Ord v => Interval v -> a -> IntervalMap v a -> IntervalMap v a
#

O(log n). Insert an interval and associated value into a map. The map may contain duplicate intervals; the new entry will be inserted before any existing entries for the same interval.

valueunion :: Ord v => IntervalMap v a -> IntervalMap v a -> IntervalMap v a
#

O(m log (n/m)). Merge two interval maps. The map may contain duplicate intervals; entries with equal intervals are kept in the original order.

Searching

3 declarations
valuesearch :: Ord v => v -> IntervalMap v a -> [(Interval v, a)]
#

O(k log (n/k)). All intervals that contain the given point, in lexicographical order.

Extraction

3 declarations