|
| Camila.State | | Portability | experimental | | Stability | experimental | | Maintainer | João Ferreira, Alexandra Mendes |
|
|
|
|
|
| Description |
| Module that defines State structure. It uses State Monad.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| type InterpState a = ST CamilaState a |
| Monad instantiated with the interpreter state. |
|
| type Instances = FiniteMap String (String, Dynamic) |
| The type of an instances store. |
|
| execute :: Show a => ST CamilaState a -> IO () |
| Execute a computation that delivers a showable type. |
|
| preOn :: InterpState () |
| Turn on precondition checking. |
|
| preOff :: InterpState () |
| Turn off precondition checking. |
|
| dtinvOn :: InterpState () |
| Turn on data type invariant checking. |
|
| dtinvOff :: InterpState () |
| Turn off data type invariant checking. |
|
| checkDTInv :: CamilaState -> Bool |
| Not used, currently |
|
| checkPre :: CamilaState -> Bool |
| Not used, currently |
|
| instances :: CamilaState -> Instances |
|
| data CamilaState |
| The type of the Camila interpreter state. It holds a map from
instance references to instances. |
|
|
| camilaInitial :: CamilaState |
| The initial state of the interpreter. |
|
| getTypeAsString |
| :: String | Instance identifier. | | -> InterpState String | | | Returns the class name of an instance. |
|
|
| addToInstances :: Instances -> InterpState () |
| Add several instances to the current store. |
|
| getInstance |
| :: String | Instance identifier. | | -> Instances | The instance store. | | -> CamilaError Dynamic | | | Retrieve an instance from a given store. |
|
|
| setState |
| :: String | Instance identifier. | | -> (String, Dynamic) | Pair of class name and object. | | -> InterpState () | | | Add an instance to the current store. |
|
|
| liftE :: (MonadError e (ErrorT e m), Monad m) => Either e a -> ErrorT e m a |
| Lift an Either term into the error monad. |
|
| runInstance |
| :: Show a | | | => ST ivars a | Computation. | | -> ivars | Initial state | | -> IO (CamilaError a) | | | Perform a given operation on a given initial state. |
|
|
| type ST ivars a = ErrorT CamilaError' (StateT ivars IO) a |
| Monad that combines all needed interpreter effects. |
|
| create |
| :: Typeable a | | | => String | Instance identifier | | -> String | Class name | | -> a | Initial state of the instance | | -> InterpState Instances | | | Create a new instance. |
|
|
| getId |
| :: String | Instance identifier. | | -> InterpState Dynamic | | | Retrieve an instance from the store. |
|
|
| Produced by Haddock version 0.6 |