module Data.Vault.LAZINESS (
Vault, Key,
empty, newKey, lookup, insert, adjust, delete, union,
Locker,
lock, unlock,
) where
import Prelude hiding (lookup)
import Control.Monad.ST
import qualified Data.Vault.ST.LAZINESS as ST
type Vault = ST.Vault RealWorld
type Key = ST.Key RealWorld
empty :: Vault
empty = ST.empty
newKey :: IO (Key a)
newKey = stToIO ST.newKey
lookup :: Key a -> Vault -> Maybe a
lookup = ST.lookup
insert :: Key a -> a -> Vault -> Vault
insert = ST.insert
adjust :: (a -> a) -> Key a -> Vault -> Vault
adjust = ST.adjust
delete :: Key a -> Vault -> Vault
delete = ST.delete
union :: Vault -> Vault -> Vault
union = ST.union
type Locker = ST.Locker RealWorld
lock :: Key a -> a -> Locker
lock = ST.lock
unlock :: Key a -> Locker -> Maybe a
unlock = ST.unlock