From 1e58cdd9e81ad6e4d7775713a70c9e1daeb7289c Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Fri, 9 Nov 2007 08:38:10 +0100 Subject: Generalize safe/unsafeSpawn to MonadIO darcs-hash:20071109073810-a5988-634efa9c3c56f39ea64be1b29791bb61c54eb6bd.gz --- XMonad/Util/Run.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs index fad92cd..e90e828 100644 --- a/XMonad/Util/Run.hs +++ b/XMonad/Util/Run.hs @@ -104,9 +104,9 @@ seconds = fromEnum . (* 1000000) $HOME and interpolation, whereas the safeSpawn example can be safe because Firefox doesn't need any arguments if it is just being started. -} -safeSpawn :: FilePath -> String -> X () -safeSpawn prog arg = io (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ()) -unsafeSpawn :: String -> X () +safeSpawn :: MonadIO m => FilePath -> String -> m () +safeSpawn prog arg = liftIO (try (forkProcess $ executeFile prog True [arg] Nothing) >> return ()) +unsafeSpawn :: MonadIO m => String -> m () unsafeSpawn = spawn -- | Run a given program in the preferred terminal emulator. This uses safeSpawn. -- cgit v1.2.3