diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-09 07:42:14 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-09 07:42:14 +0100 |
commit | 9d13cf57b31055d21f51257d73c9c946c18b6b44 (patch) | |
tree | a5bb278b6a76405e8ff9a0f885be915edd9e573d /XMonad | |
parent | 2bae2a4816fd0fb241bd5db0b66efee098ce1924 (diff) | |
download | metatile-9d13cf57b31055d21f51257d73c9c946c18b6b44.tar metatile-9d13cf57b31055d21f51257d73c9c946c18b6b44.zip |
Generalize several functions to MonadIO
darcs-hash:20071109064214-a5988-9d6f69bc6314fd4e4a58edff8442715a5b016400
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Core.hs | 8 |
1 files changed, 4 insertions, 4 deletions
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 |