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

Safe HaskellNone
LanguageHaskell2010

Transient.Backtrack

Contents

Description

Synopsis

Documentation

generalized versions of backtracking with an extra parameter that gives the reason for going back.

onBack :: (Typeable b, Show b) => TransientIO a -> (b -> TransientIO a) -> TransientIO a Source #

The second parameter will be executed when backtracking

back :: (Typeable b, Show b) => b -> TransientIO a Source #

Execute backtracking. It execute the registered actions in reverse order.

If the backtracking flag is changed the flow proceed forward from that point on.

If the backtrack stack is finished or undoCut executed, undo will stop.

forward :: (Typeable b, Show b) => b -> TransIO () Source #

backtracking is stopped. the exection continues forward from this point on.

backCut :: (Typeable reason, Show reason) => reason -> TransientIO () Source #

Assures that backtracking will not go further back

registerBack :: (Typeable b, Show b) => b -> TransientIO a -> TransientIO a Source #

Register an action that will be executed when backtracking

finalization primitives

finish :: Maybe SomeException -> TransIO a Source #

Trigger the event, so this closes all the resources

onFinish :: (Maybe SomeException -> TransIO ()) -> TransIO () Source #

Set a computation to be called when the finish event happens

onFinish' :: TransIO a -> (Maybe SomeException -> TransIO a) -> TransIO a Source #

Set a computation to be called when the finish event happens this only apply for

initFinish :: TransientIO () Source #

Initialize the event variable for finalization. all the following computations in different threads will share it it also isolate this event from other branches that may have his own finish variable

checkFinalize :: StreamData a -> TransIO a Source #

trigger finish when the stream of data ends