HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebrick-2.10Haskell2010

Data.IMap

  • 2 types
  • 15 values
  • Packagebrick-2.10
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceIMap.hs
newtypenewtype IMap a
#

Semantically, IMap and IntMap are identical; but IMap is more efficient when large sequences of contiguous keys are mapped to the same value.

Instances9Functor, Applicative, Eq, Ord, Read, Show, …
datadata Run a
#

Run n a represents n copies of the value a.

Constructors

Instances10Functor, Foldable, Traversable, Eq, Ord, Read, …
valuerestrict :: Int -> Run ignored -> IMap a -> IMap a
#

Given a range of keys (as specified by a starting key and a length for consistency with other functions in this module), restrict the map to keys in that range. restrict k r m is equivalent to intersectionWith const m (insert k r empty) but potentially more efficient.

valuesplitLE :: Int -> IMap a -> (IMap a, IMap a)
#

splitLE n m produces a tuple (le, gt) where le has all the associations of m where the keys are <= n and gt has all the associations of m where the keys are > n.

valueunsafeUnion :: IMap a -> IMap a -> IMap a
#

This function is unsafe because it assumes there is no overlap between its arguments. That is, in the call unsafeUnion a b, the caller must guarantee that if lookup k a = Just v then lookup k b = Nothing and vice versa.

valueunsafeRuns :: IMap a -> IntMap (Run a)
#

This function is unsafe because IMaps that compare equal may split their runs into different chunks; consumers must promise that they do not treat run boundaries specially.

valueunsafeToAscList :: IMap a -> [(Int, Run a)]
#

This function is unsafe because IMaps that compare equal may split their runs into different chunks; consumers must promise that they do not treat run boundaries specially.