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
type Vault = 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
type Key = Key
Keys for the vault.
type Key :: * -> * -> *
insert :: Key s a -> a -> Vault s -> Vault s
Insert a value for a given key. Overwrites any previous value.
adjust :: (a -> a) -> Key s a -> Vault s -> Vault s
Adjust the value for a given key if it's present in the vault.
Locker
type Locker = Locker
A persistent store for a single value.
type Locker :: * -> *