From ef7cd124086bd3c91eb5fea9bb13057a82c71f29 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sun, 24 Jan 2010 21:33:24 +0100 Subject: Use extensible-exceptions to allow base-3 or base-4 Ignore-this: 136f35fcc0f3a824b96eea0f4e04f276 darcs-hash:20100124203324-1499c-6e811978a61feebf704e3cd7543cbcc0b3e8a0b3.gz --- XMonad/Util/Run.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'XMonad/Util/Run.hs') diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs index c884818..2afdae5 100644 --- a/XMonad/Util/Run.hs +++ b/XMonad/Util/Run.hs @@ -33,8 +33,9 @@ module XMonad.Util.Run ( import System.Posix.IO import System.Posix.Process (executeFile) +import System.Posix.Types (ProcessID) import Control.Concurrent (threadDelay) -import Control.Exception (try) -- use OldException with base 4 +import Control.Exception.Extensible (try,SomeException) import System.IO import System.Process (runInteractiveProcess) import XMonad @@ -107,7 +108,9 @@ it makes use of shell interpretation by relying on @$HOME@ and interpolation, whereas the safeSpawn example can be safe because Firefox doesn't need any arguments if it is just being started. -} safeSpawn :: MonadIO m => FilePath -> [String] -> m () -safeSpawn prog args = liftIO (try (xfork $ executeFile prog True args Nothing) >> return ()) +safeSpawn prog args = liftIO $ do + try $ xfork $ executeFile prog True args Nothing :: IO (Either SomeException ProcessID) + return () -- | Like 'safeSpawn', but only takes a program (and no arguments for it). eg. -- -- cgit v1.2.3