IntervalMap alternatives and similar packages
Based on the "Data" category.
Alternatively, view IntervalMap alternatives based on common mentions on social networks and blogs.
-
semantic-source
Parsing, analyzing, and comparing source code across many languages -
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
text
Haskell library for space- and time-efficient operations over Unicode text. -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
unordered-containers
Efficient hashing-based container types -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
holmes
A reference library for constraint-solving with propagators and CDCL. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
binary
Efficient, pure binary serialisation using ByteStrings in Haskell. -
primitive
This package provides various primitive memory-related operations. -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
audiovisual
Extensible records, variants, structs, effects, tangles -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
IORefCAS
A collection of different packages for CAS based data structures. -
dependent-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
safecopy
An extension to Data.Serialize with built-in version control -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
uuid-types
A Haskell library for creating, printing and parsing UUIDs
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of IntervalMap or a related project?
README
IntervalMap

Containers for intervals. Like Data.Set
and Data.Map
with
Intervals as keys and functions for efficiently getting the subset
of all intervals containing a point, intersecting an interval, and more.
Home page and documentation: http://www.chr-breitkopf.de/comp/IntervalMap/index.html
Getting started
Enable necessary language extensions:
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
In most cases, you should use the value-strict version:
import qualified Data.IntervalMap.Generic.Strict as IM
Make tuples an instance of Interval:
instance Ord e => IM.Interval (e,e) e where
lowerBound (a,_) = a
upperBound (_,b) = b
rightClosed _ = False
By using rightClosed _ = False
we have defined tuples to be half-open
intervals - they include the starting value, but not the end value.
Let's create a map from (Int,Int)
intervals to strings:
type MyMap = IM.IntervalMap (Int,Int) String
sample :: MyMap
sample = IM.fromList [((1,6), "Foo"), ((2,4), "Bar"), ((4,7), "Baz")]
Lookup intervals containing a given point ("stabbing query"):
> IM.toAscList (sample `IM.containing` 3)
[((1,6),"Foo"),((2,4),"Bar")]
> IM.toAscList (sample `IM.containing` 4)
[((1,6),"Foo"),((4,7),"Baz")]