module Database.Haskey.Alloc.Transaction where
import Data.BTree.Alloc.Class
import Data.BTree.Impure.Structures
data Transaction key val a =
Commit (Tree key val) a
| Abort a
commit :: AllocM n => a -> Tree key val -> n (Transaction key val a)
commit v t = return $ Commit t v
commit_ :: AllocM n => Tree key val -> n (Transaction key val ())
commit_ = commit ()
abort :: AllocM n => a -> n (Transaction key val a)
abort = return . Abort
abort_ :: AllocM n => n (Transaction key val ())
abort_ = return $ Abort ()