| Safe Haskell | None |
|---|
Data.Vault.ST
- type Vault = Vault
- type Key = Key
- empty :: Vault s
- newKey :: ST s (Key s a)
- lookup :: Key s a -> Vault s -> Maybe a
- insert :: Key s a -> a -> Vault s -> Vault s
- adjust :: (a -> a) -> Key s a -> Vault s -> Vault s
- delete :: Key s a -> Vault s -> Vault s
- union :: Vault s -> Vault s -> Vault s
- type Locker = Locker
- lock :: Key s a -> a -> Locker s
- unlock :: Key s a -> Locker s -> Maybe a
Synopsis
A persistent store for values of arbitrary types.
Variant for the ST monad.
Vault
A persistent store for values of arbitrary types.
This variant is the simplest and creates keys in the IO monad.
See the module Data.Vault.ST if you want to use it with the ST monad instead.
type Vault :: * -> * instance Monoid 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.