tsession-happstack-0.1: A Transaction Framework for Happstack

Safe HaskellNone
LanguageHaskell98

Control.TSession.Happstack

Documentation

atomicTransactionPart :: (Ord k, Eq v, MonadIO m, Functor m, HasRqData m, FilterMonad Response m, MonadPlus m) => TransactionBase k v status -> Trans k v status a -> m a Source

createTransaction :: Ord k => String -> (g -> (TSessionId, g), g) -> status -> (k -> IO (Maybe v)) -> (k -> v -> IO ()) -> NominalDiffTime -> IO (TransactionBase k v status)

readVal :: Ord k => k -> Trans k v status (Maybe v, TouchedValues v status)

safeLoadVal :: Ord k => k -> Trans k v status (Maybe v)

writeVal :: Ord k => k -> v -> Trans k v status ()

setStatus :: Eq status => status -> Trans k v status ()

getStatus :: Trans k v status status

getReadSet :: Ord k => Trans k v status (Map k [TouchedValue v status])

commit :: Trans k v status ()

finishSession :: Trans k v status ()

data TouchedValue v status :: * -> * -> *

Instances

(Eq v, Eq status) => Eq (TouchedValue v status) 
(Ord v, Ord status) => Ord (TouchedValue v status) 
(Show v, Show status) => Show (TouchedValue v status) 

data TouchedValues v status :: * -> * -> *

Instances

(Show v, Show status) => Show (TouchedValues v status) 

data TransactionBase k v status :: * -> * -> * -> *

Constructors

TransactionBase 

Fields

_trBaseName :: String
 
_trBaseLoadFun :: k -> IO (Maybe v)
 
_trBaseSaveFun :: k -> v -> IO ()
 
_trBaseTouchedValues :: MVar (Map k [TouchedValue v status])
 
_tsessions :: TSessions k v status
 
_tsessionIdGenerator :: TSessionIdGenerator
 
_tsessioninitStatus :: status
 
_tsessionTimeout :: NominalDiffTime
 
_tsessionTimeoutIndex :: IORef (Map TSessionId Timeout)
 

newtype Trans k v status a :: * -> * -> * -> * -> *

Constructors

Trans 

Fields

runTransactionPart :: StateT (TSessionState k v status) IO (TransactionResult a)
 

Instances

Monad (Trans k v status)