transient-0.4.2: Making composable programs with multithreading, events and distributed computing

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 :: (Typeable * a, Show a, Read a) => a -> IDynamic Source #

logged :: Loggable 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 <- logged $ do
         logged this :: TransIO ()
         logged that :: TransIO ()
         logged thatOther
 liftIO $ print r

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

but at the thatOther execution the log is: [Exec,(), ()]