selfrestart-0.1.0: Restarts the current executable (on binary change)

Safe HaskellNone



Allows restarting the currently running executable.

Works with binaries and runhaskell/runghc. In ghci all functions are no-ops.



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.