Safe Haskell | None |
---|
Allows restarting the currently running executable.
Works with binaries and runhaskell
/runghc
. In ghci
all functions are no-ops.
- selfRestart :: IO ()
- forkSelfRestartExePoll :: Double -> IO (Maybe ThreadId)
- forkSelfRestartExePollWithAction :: Double -> IO () -> IO (Maybe ThreadId)
Documentation
USE WITH CARE. This module uses getScriptPath
internally, which is experimental.
Please review it.
selfRestart :: IO ()Source
Restart the currently running executable.
forkSelfRestartExePoll :: Double -> IO (Maybe ThreadId)Source
Forks a thread to check poll the own binary's modification time every, and restarts, and restarts it when it gets changed.
Waits the given number of seconds between checks.
forkSelfRestartExePollWithAction :: Double -> IO () -> IO (Maybe ThreadId)Source
Like forkSelfRestartExePoll
, but you can run an action just before the restart
happens.