From 9d13cf57b31055d21f51257d73c9c946c18b6b44 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Fri, 9 Nov 2007 07:42:14 +0100 Subject: Generalize several functions to MonadIO darcs-hash:20071109064214-a5988-9d6f69bc6314fd4e4a58edff8442715a5b016400 --- XMonad/Core.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'XMonad') diff --git a/XMonad/Core.hs b/XMonad/Core.hs index 56700c0..2a6a715 100644 --- a/XMonad/Core.hs +++ b/XMonad/Core.hs @@ -258,8 +258,8 @@ catchIO :: IO () -> X () catchIO f = liftIO (f `catch` \e -> hPrint stderr e >> hFlush stderr) -- | spawn. Launch an external application -spawn :: String -> X () -spawn x = io $ do +spawn :: MonadIO m => String -> m () +spawn x = liftIO $ do pid <- forkProcess $ do forkProcess (createSession >> executeFile "/bin/sh" False ["-c", x] Nothing) exitWith ExitSuccess @@ -291,5 +291,5 @@ whenX a f = a >>= \b -> when b f -- | A 'trace' for the X monad. Logs a string to stderr. The result may -- be found in your .xsession-errors file -trace :: String -> X () -trace msg = io $! do hPutStrLn stderr msg; hFlush stderr +trace :: MonadIO m => String -> m () +trace msg = liftIO $ do hPutStrLn stderr msg; hFlush stderr -- cgit v1.2.3