vault-0.1.0.0: a typed, persistent store for values of arbitrary types

Safe HaskellSafe-Infered

Data.Vault.ST

Synopsis

Documentation

data Vault s Source

A typed, persistent store for values of arbitrary types.

This variant has more complex types so that you can create keys in the ST monad. See the module Data.Vault if you'd like to use a simpler version with the IO monad. You can also use both variants simultaneously; they share a single representation.

Instances

data Key s a Source

Keys for the vault.

empty :: Vault sSource

The empty vault.

newKey :: ST s (Key s a)Source

Create a new key for use with a vault.

lookup :: Key s a -> Vault s -> Maybe aSource

Lookup the value of a key in the vault.

insert :: Key s a -> a -> Vault s -> Vault sSource

Insert a value for a given key. Overwrites any previous value.

adjust :: (a -> a) -> Key s a -> Vault s -> Vault sSource

Adjust the value for a given key if it's present in the vault.

delete :: Key s a -> Vault s -> Vault sSource

Delete a key from the vault.

union :: Vault s -> Vault s -> Vault sSource

Merge two vaults (left-biased).