-- | trigger the event, so this closes all the resources
finish :: FinishReason -> TransIO ()
finish e= do
    liftIO $ putStr  "finish: " >> print e
    Finish finish <- getSData <|> initFinish
    lastWriteEVar finish e

-- | deregister all the finalization actions.
-- A initFinish is needed to register actions again
finish :: FinishReason -> TransIO ()
finish e= do
    liftIO $ putStr  "finish: " >> print e
    Finish finish <- getSData <|> initFinish
    lastWriteEVar finish e

-- | deregister all the finalization actions.
-- A initFinish is needed to register actions again
finish e= do
    liftIO $ putStr  "finish: " >> print e
    Finish finish <- getSData <|> initFinish
    lastWriteEVar finish e

-- | deregister all the finalization actions.
-- A initFinish is needed to register actions again