| Copyright | (c) 2016 Michael Walker |
|---|---|
| License | MIT |
| Maintainer | Michael Walker <mike@barrucadu.co.uk> |
| Stability | experimental |
| Portability | ExistentialQuantification, RankNTypes |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Test.DejaFu.STM.Internal
Description
MonadSTM testing implementation, internal types and
definitions. This module is NOT considered to form part of the
public interface of this library.
- type M n r a = Cont (STMAction n r) a
- data STMAction n r
- newtype TVar r a = TVar (TVarId, r a)
- data Result a
- isSTMSuccess :: Result a -> Bool
- doTransaction :: MonadRef r n => M n r a -> IdSource -> n (Result a, n (), IdSource, TTrace)
- stepTrans :: MonadRef r n => STMAction n r -> IdSource -> n (STMAction n r, n (), IdSource, [TVarId], [TVarId], TAction)
Documentation
type M n r a = Cont (STMAction n r) a Source #
The underlying monad is based on continuations over primitive actions.
Primitive actions
STM transactions are represented as a sequence of primitive actions.
TVars
Output
The result of an STM transaction, along with which TVars it
touched whilst executing.
Constructors
| Success [TVarId] [TVarId] a | The transaction completed successfully, reading the first list
|
| Retry [TVarId] | The transaction aborted by calling |
| Exception SomeException | The transaction aborted by throwing an exception. |