Safe Haskell | None |
---|---|
Language | Haskell2010 |
Patches of this sort allow for insert/update or delete of associations.
Synopsis
- newtype PatchIntMap a = PatchIntMap {
- unPatchIntMap :: IntMap (Maybe a)
- mapIntMapPatchWithKey :: (Int -> a -> b) -> PatchIntMap a -> PatchIntMap b
- traverseIntMapPatchWithKey :: Applicative f => (Int -> a -> f b) -> PatchIntMap a -> f (PatchIntMap b)
- patchIntMapNewElements :: PatchIntMap a -> [a]
- patchIntMapNewElementsMap :: PatchIntMap a -> IntMap a
- getDeletions :: PatchIntMap v -> IntMap v' -> IntMap v'
Documentation
newtype PatchIntMap a Source #
Patch
for IntMap
which represents insertion or deletion of keys in the mapping.
Internally represented by 'IntMap (Maybe a)', where Just
means insert/update
and Nothing
means delete.
PatchIntMap | |
|
Instances
mapIntMapPatchWithKey :: (Int -> a -> b) -> PatchIntMap a -> PatchIntMap b Source #
Map a function Int -> a -> b
over all a
s in the given
(that is, all inserts/updates), producing a PatchIntMap
aPatchIntMap b
.
traverseIntMapPatchWithKey :: Applicative f => (Int -> a -> f b) -> PatchIntMap a -> f (PatchIntMap b) Source #
Map an effectful function Int -> a -> f b
over all a
s in the given
(that is, all inserts/updates), producing a PatchIntMap
af (PatchIntMap b)
.
patchIntMapNewElements :: PatchIntMap a -> [a] Source #
Extract all a
s inserted/updated by the given
.PatchIntMap
a
patchIntMapNewElementsMap :: PatchIntMap a -> IntMap a Source #
Convert the given
into an PatchIntMap
a
with all
the inserts/updates in the given patch.IntMap
a
getDeletions :: PatchIntMap v -> IntMap v' -> IntMap v' Source #
Subset the given
to contain only the keys that would be
deleted by the given IntMap
a
.PatchIntMap
a