Hi<br><br>I&#39;m proud to announce Workflow 0.5.5. Workflow has a monad transformer that encapsulates any monad in a state monad that bring  automatic state logging and recovery.  A workflow can be viewed as a thread that persist across planeed or unplanned application shutdowns.  When recovering the excution is resumed at the last action that was logged. The process continues at the same state as if not interruption took place.<div>
<br></div><div>Any feedback will be appreciated.<br><br>Besides state logging and recovery, there are a number of communication primitives that are aware of persistence across reinitiations such are persistent queues, persistent timeouts, or wait for events in the STM monad. These primitives permits inter-woikflow communications and communications with external threads. I hope that this package would be useful for very long computations, either the programs that are CPU intensive and produce valuable intermediate data or  programs that wait for actions from users and others processes during days or weeks. That is typical in web applications.  Such programs can be defined in a single monadic procedure transparently, without regards of saving intermediate results or reinitiations at the correct point.<br>
<br>This new version is not restricted to handle a single type. Every intermediate data must be an instance of Read and Show. For complex data types,  other persistence mechanisms can be used (see documentation). <br><br>
 The package is at:<br><br><a href="http://hackage.haskell.org/package/Workflow ">http://hackage.haskell.org/package/Workflow </a><br><a href="http://hackage.haskell.org/packages/archive/Workflow/0.5.5/Workflow-0.5.5.tar.gz ">http://hackage.haskell.org/packages/archive/Workflow/0.5.5/Workflow-0.5.5.tar.gz </a><br>
<br><div>The tar archive has the documentation and some examples. Among them, a simulation of workflow for the creation and approval of documents, with two levels of approval and approval timeouts, It uses most of  the features of the package.<br>
<br>NOTE: cabal install reports Tar checksum errors when installed, however, such errors do not appear by downloading the tar.gz archive and decompressing it with the unix or windows tools. I do not know why cabal install behaves as such.<br>
<br><br>Here is a simple example: This is a counter that shows a sequence of numbers, one a second:<br><br><i>module Main where<br>import Control.Concurrent(threadDelay)<br>import System.IO (hFlush,stdout)<br><br>count n= do<br>
                    putStr (show n ++ &quot; &quot; ) &gt;&gt; hFlush stdout &gt;&gt; threadDelay 1000000<br>                    count (n+1)<br><br>main= count 0<br></i><br>This is the same program, with the added feature of remembering the last count after interruption (sequence.hs):<br>
<br><i>module Main where<br>import Control.Workflow<br>import Control.Concurrent(threadDelay)<br>import System.IO (hFlush,stdout)<br><br>mcount n= do<br>            <b>step</b> $  putStr (show n ++ &quot; &quot; ) &gt;&gt; hFlush stdout &gt;&gt; threadDelay 1000000<br>
            mcount (n+1)<br><br>main= do<br>   registerType :: IO ()<br>   registerType :: IO Int<br>   let start= 0 :: Int<br>   startWF  &quot;count&quot;  start   [(&quot;count&quot;, mcount)] :: IO ()<br></i><br>This is the execution log:<br>
<br><i>Worflow-0.5.5demos&gt;runghc sequence.hs<br><b>0 1 2 3 4 5 6 7</b> sequence.hs: win32ConsoleHandler<br>sequence.hs: sequence.hs: interrupted<br>Worflow-0.5.5demos&gt;<br>Worflow-0.5.5demos&gt;runghc sequence.hs<br>
<b>7 8 9 10 11 </b>....<br></i><br><br><br>This package uses TCache and RefSerialize.   I also uploaded new versions of these packages with extensive documentation and examplles included in the tar.gz archives ( cabal install also repor checksum errors, but are OK when downloading and installing by hand):<br>
<br><a href="http://hackage.haskell.org/package/TCache">http://hackage.haskell.org/package/TCache </a></div><div><a href="http://hackage.haskell.org/packages/archive/TCache/0.6.4/TCache-0.6.4.tar.gz ">http://hackage.haskell.org/packages/archive/TCache/0.6.4/TCache-0.6.4.tar.gz </a><br>
<br><a href="http://hackage.haskell.org/package/RefSerialize ">http://hackage.haskell.org/package/RefSerialize </a></div><div><a href="http://hackage.haskell.org/packages/archive/RefSerialize/0.2.4/RefSerialize-0.2.4.tar.gz">http://hackage.haskell.org/packages/archive/RefSerialize/0.2.4/RefSerialize-0.2.4.tar.gz</a></div>
</div>