Workflow 0.7.0.1 → 0.7.0.2
raw patch · 2 files changed
+6/−31 lines, 2 files
Files
- Control/Workflow.hs +3/−28
- Workflow.cabal +3/−3
Control/Workflow.hs view
@@ -873,37 +873,12 @@ return (map, Nothing) --- | Return the reference to the last logged result , usually, the last result stored by `step`.--- wiorkflow references can be accessed outside of the workflow--- . They also can be (de)serialized.------ WARNING getWFRef can produce casting errors when the type demanded--- do not match the serialized data. Instead, `newDBRef` and `stepWFRef` are type safe at runtuime.---getWFRef :: ( Monad m,--- MonadIO m,--- Serialize a--- , Typeable a)--- => Workflow m (WFRef a)---getWFRef =ret !> "geWFRef"--- where--- ret= WF (\s -> do--- let n= if recover s then state s - (L.length $ versions s)--- else (state s -1)--- let ref = WFRef n (self s)--- -- to reify the object being accessed--- -- if not reified, the serializer will write a null object--- let versionss= versions s--- when ( L.null versionss) $ error "getWFRef: empty log, no step to point to"--- let r= fromIDyn (L.head $ versionss) `asTypeOf` typeofRef ret--- r `seq` return (s,ref))--- where--- typeofRef :: Workflow m (WFRef a) -> a--- typeofRef= undefined -- never will be executed --- | Log a value and return a reference to it.++-- | Log a value in the workflow log and return a reference to it. ----- @newWFRef x= `step` $ return x >>= `getWFRef`@+-- @newWFRef x= `stepWFRef` (return x) >>= return . fst@ newWFRef :: ( Serialize a , Typeable a , MonadIO m
Workflow.cabal view
@@ -1,5 +1,5 @@ name: Workflow-version: 0.7.0.1+version: 0.7.0.2 cabal-version: >= 1.6 build-type: Simple license: BSD3@@ -7,8 +7,8 @@ maintainer: agocorona@gmail.com stability: experimental bug-reports: agocorona@gmail.com-synopsis: Monadic transformer for persistence in threads. and workflow patterns-description: Transparent support for interruptible computations. A workflow can be seen as a persistent thread that executes any+synopsis: Monad transformer for thread state persistence and workflow patterns+description: Transparent support for interruptible computations. A workflow can be seen as a persistent thread that executes a monadic computation. Therefore, it can be used in very time consuming computations such are CPU intensive calculations or procedures that are most of the time waiting for the action of a process or an user, that are prone to comunication failures, timeouts or shutdowns. It also can be used if you like to restart your