transient-0.1.0.8: A monad for extensible effects and primitives for unrestricted composability of applications

Safe HaskellNone
LanguageHaskell2010

Transient.Logged

Description

 

Synopsis

Documentation

class (Show a, Read a, Typeable a) => Loggable a Source

Instances

(Show a, Read a, Typeable * a) => Loggable a Source 

fromIDyn :: (Read a, Show a, Typeable a) => IDynamic -> a Source

toIDyn :: (Read a, Show a, Typeable * a) => a -> IDynamic Source

logged :: (Show a, Read a, Typeable a) => TransientIO a -> TransientIO a Source

synonymous of step

step :: (Show a, Read a, Typeable a) => TransientIO a -> TransientIO a Source

write the result of the computation in the log and return it. but if there is data in the internal log, it read the data from the log and do not execute the computation.

It accept nested step's. The effect is that if the outer step is executed completely the log of the inner steps are erased. If it is not the case, the inner steps are logged this reduce the log of large computations to the minimum. That is a feature not present in the package Workflow.

 r <- step $ do
         step this :: TransIO ()
         step that :: TransIO ()
         step thatOther
 liftIO $ print r

when print is executed, the log is just the value of r.

but when thatOther is executed the log is: [Exec,(), ()]