Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines IntToIntMap
, a variant of IntMap
in which the
values are fixed to Int
.
We make use of this structure in ReprUnionFind
to
improve performance by a constant factor
Synopsis
- data IntToIntMap :: UnliftedType = Nil
- type Key = Int#
- type Val = Int#
- find :: Key -> IntToIntMap -> Val
- insert :: Key -> Val -> IntToIntMap -> IntToIntMap
- (!) :: IntToIntMap -> Key -> Val
- unliftedFoldr :: forall a {b :: UnliftedType}. (a -> b -> b) -> b -> [a] -> b
Documentation
data IntToIntMap :: UnliftedType Source #
A map of integers to integers
Nil | An empty |
Key type synonym in an IntToIntMap
Value type synonym in an IntToIntMap
find :: Key -> IntToIntMap -> Val Source #
Find the Val
for a Key
in an IntToIntMap
insert :: Key -> Val -> IntToIntMap -> IntToIntMap Source #
Insert a Val
at a Key
in an IntToIntMap
(!) :: IntToIntMap -> Key -> Val Source #
\(O(\min(n,W))\). Find the value at a key.
Calls error
when the element can not be found.
unliftedFoldr :: forall a {b :: UnliftedType}. (a -> b -> b) -> b -> [a] -> b Source #
A foldr
in which the accumulator is unlifted