stable-tree-0.6.1: Trees whose branches are resistant to change

Safe HaskellNone
LanguageHaskell2010

Data.StableTree.Mutate

Synopsis

Documentation

insert :: (Ord k, Serialize k, Serialize v) => k -> v -> StableTree k v -> StableTree k v Source

Insert a key/value into a StableTree. If the key exists, its existing value is overwritten.

delete :: (Ord k, Serialize k, Serialize v) => k -> StableTree k v -> StableTree k v Source

Remove a key from the StableTree. If the key is not found, the tree is returned unchanged.

fmap :: (SerialFunctor f, Serialize a, Serialize b) => (a -> b) -> f a -> f b Source

Same as the fmap instance of Functor, but with the restriction that the input and output of the mutation function must be Serialize-able. Using the real instance would be really cool, but we need that Serialize instance.