A persistent store for values of arbitrary types.
Vault type in this module is strict in both keys and values.
- type Vault = Vault RealWorld
- type Key = Key RealWorld
- empty :: Vault
- newKey :: IO (Key a)
- lookup :: Key a -> Vault -> Maybe a
- insert :: Key a -> a -> Vault -> Vault
- adjust :: (a -> a) -> Key a -> Vault -> Vault
- delete :: Key a -> Vault -> Vault
- union :: Vault -> Vault -> Vault
- type Locker = Locker RealWorld
- lock :: Key a -> a -> Locker
- unlock :: Key a -> Locker -> Maybe a
Insert a value for a given key. Overwrites any previous value.
Adjust the value for a given key if it's present in the vault.