Safe Haskell | None |
---|---|
Language | Haskell98 |
- data JobActionState e a = JobActionState {
- jobActions :: [ActionFn e a]
- data (Env e, Unit a) => JobM e a b
- data ActionM e a b
- type ActionFn e a = e -> a -> IO (Maybe (JobResult a))
- data ActionError = ActionError Alert String
- data ActionEnv e a = ActionEnv {
- getJobEnv :: e
- getJobUnit :: a
- class (Read a, Show a, Desc a, Eq a) => Unit a where
- getPriority :: a -> Int
- getRecovery :: a -> a
- data Next a = Next {}
- data Failure = Failure Alert String
- type JobResult a = Either Failure (Next a)
- data Alert
- setNextJob :: Unit a => a -> JobResult a -> JobResult a
- addForkJob :: Unit a => (a, Maybe UTCTime) -> JobResult a -> JobResult a
- runS :: JobM e a b -> StateT (JobActionState e a) IO b
- runAM :: ActionM e a b -> ErrorT ActionError (ReaderT (ActionEnv e a) (StateT (JobResultState a) IO)) b
- addAction :: (Env e, Unit a) => ActionFn e a -> JobActionState e a -> JobActionState e a
- setResult :: Unit a => Maybe (JobResult a) -> JobResultState a -> JobResultState a
Documentation
data JobActionState e a Source
JobActionState | |
|
Default (JobActionState e a) | |
MonadState (JobActionState e a) (JobM e a) |
data (Env e, Unit a) => JobM e a b Source
Monad (JobM e a) | |
Functor (JobM e a) | |
MonadIO (JobM e a) | |
MonadState (JobActionState e a) (JobM e a) |
MonadError ActionError (ActionM e a) | |
Monad (ActionM e a) | |
Functor (ActionM e a) | |
MonadIO (ActionM e a) | |
MonadReader (ActionEnv e a) (ActionM e a) |
data ActionError Source
ActionEnv | |
|
MonadReader (ActionEnv e a) (ActionM e a) |
class (Read a, Show a, Desc a, Eq a) => Unit a where Source
Unit class
Nothing
getPriority :: a -> Int Source
Define the priority of a unit.
getRecovery :: a -> a Source
Define the recovery state of a unit.
setNextJob :: Unit a => a -> JobResult a -> JobResult a Source
runAM :: ActionM e a b -> ErrorT ActionError (ReaderT (ActionEnv e a) (StateT (JobResultState a) IO)) b Source
addAction :: (Env e, Unit a) => ActionFn e a -> JobActionState e a -> JobActionState e a Source