úÎPLLÃ*      !"#$%&'()9*+,-./0 gPMonadTrans permits |to define a partial monad transformer. They are not defined for all kinds of data mbut the ones that have instances of certain classes.That is because in the lift instance code there are some Shidden use of these classes. This also may permit an accurate control of effects. 8An instance of MonadTrans is an instance of PMonadTrans 8Indexablle can be used to derive instances of IResource + This is the set of automatic derivations: !(Read a, Show a) => Serialize a QTypeable a => Indexable a (a single key for all values. enough for workflows) *(Indexable a, Serialize a) => IResource a 123456789:;<=hexecutes a IO computation inside of the workflow monad whatever the monad encapsulated in the workflow. 0 Warning: this computation is executed whenever ~ the workflow restarts, no matter if it has been already executed previously. This is useful for intializations or debugging. / To avoid re-execution when restarting use:  $ unsafeIOtoWF... iTo perform IO actions in a workflow that encapsulates an IO monad, use step over the IO action directly:    $ action instead of   $ unsafeIOtoWF $ actionustep lifts a monadic computation to the WF monad, and provides transparent state loging and resume of computation start or continue a workflow. &name of workflow in the workflow list Hinitial value (even use the initial value even to restart the workflow) Mworkflow list. t is an assoc-list of (workflow name string,Workflow methods) result of the computation >ire-start the non finished workflows started for all initial values that are listed in the workflow list 3change the logging policy (default is syncronous) . Workflow uses the package TCache for logging n for very fast workflow steps or when TCache is used also for other purposes , asyncronous is a better option ETrue means syncronoys: changes are inmediately saved after each step 1number of seconds between saves when asyncronous size of the cache when async in the workflow monad Ethe step number. If negative, count from the current state backwards )return the n-tn intermediate step result Zreturn all the intermediate results. it is supposed that all the intermediate result have  the same type. Alog a message in the workflow history. I can be printed out with printWFhistory 0return the list of object keys that are running =return the current state of the computation, in the IO monad @delete the workflow. Make sure that the workdlow is not running Rprint the state changes along the workflow, that is, all the intermediate results ?@nwait until a TCache object (with a certaing key) meet a certain condition (useful to check external actions ) _ NOTE if anoter process delete the object from te cache, then waitForData will no longuer work 4 inside the wokflow, it can be used by lifting it :  do  x < - step $ ..  y <- step $ waitForData ...  .. 2The condition that the retrieved object must meet Ba partially defined object for which keyResource can be extracted Jreturn the retrieved object that meet the condition and has the given key A2The condition that the retrieved object must meet Ba partially defined object for which keyResource can be extracted Jreturn the retrieved object that meet the condition and has the given key 2The condition that the retrieved object must meet The workflow name 3the INITIAL value used in the workflow to start it (The first event that meet the condition B2The condition that the retrieved object must meet The workflow name 3the INITIAL value used in the workflow to start it (The first event that meet the condition 9start the timeout and return the flag to be monitored by    4wait until a certain clock time, in the STM monad. A This permits to compose timeouts with locks waiting for data. iexample: wait for any respoinse from a Queue if no response is given in 5 minutes, it is returned True.   flag <- getTimeoutFlag $ 5 * 60  ap  M- step . atomically $ readQueueSTM docQueue `orElse` waitUntilSTM flag > return True  case ap of  False ->  False or timeout >> correctWF doc  True -> do !"Edelete elements from the Queue stack and return them in the IO monad  Queue name the returned elems #Gdelete elements from the Queue stack an return them. in the STM monad $%&,insert an element on top of the Queue Stack '&Like writeQueue, but in the STM monad )C8An instance of MonadTrans is an instance of PMonadTrans D plift= step *  !"#$%&'()*  ! &'"#$%()   !"#$%&')E      !"#$%&'()*+,-.//012334456789:;<==>?@ABCDEFWorkflow-0.5.6Control.Workflow TCache-0.6.5Data.TCache.IDynamic registerTypeData.TCache.IResource delResource writeResource readResourcedefPathtreadptshowp deserialize serialize keyResource IResource PMonadTransplift Indexablekey WorkflowListWorkflow unsafeIOtoWFstepstartWFrestartWorkflows syncWritegetStepgetAlllogWF getWFKeys getWFHistory delWFHistory printHistorywaitForgetTimeoutFlaggetTimeSeconds waitUntilSTM waitUntil readQueue readQueueSTM unreadQueueunreadQueueSTM writeQueue writeQueueSTM isEmptyQueueisEmptyQueueSTMQueuenameimpoutPrettyStatwfNamestateindexrecoversyncversionstimeoutRunningWorkflowsWFstrunWF reference waitForDatawaitForDataSTM waitForSTM$fPMonadTranstma$fPMonadTransWFma