aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/Run.hs
diff options
context:
space:
mode:
authordaniel <daniel@wagner-home.com>2009-11-14 03:36:16 +0100
committerdaniel <daniel@wagner-home.com>2009-11-14 03:36:16 +0100
commitaf1ff15bc43bd1ddcae94237bce560c1251a569d (patch)
tree0abfea358c31302b53d4085756a347e47609628e /XMonad/Util/Run.hs
parent9a01f2b662dc29820c80ef65a54ae2d8afa2e7ff (diff)
downloadXMonadContrib-af1ff15bc43bd1ddcae94237bce560c1251a569d.tar.gz
XMonadContrib-af1ff15bc43bd1ddcae94237bce560c1251a569d.tar.xz
XMonadContrib-af1ff15bc43bd1ddcae94237bce560c1251a569d.zip
generalize IO actions to MonadIO m
Ignore-this: 2c801a27b0ffee34a2f0daca3778613a This should not cause any working configs to stop working, because IO is an instance of MonadIO, and because complete configs will pin down the type of the call to IO. Note that XMonad.Config.Arossato is not a complete config, and so it needed some tweaks; with a main function, this should not be a problem. darcs-hash:20091114023616-c98ca-0a233cc53c41986845db4300530ec4f9e4d52a37.gz
Diffstat (limited to 'XMonad/Util/Run.hs')
-rw-r--r--XMonad/Util/Run.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs
index 2966053..1e82b55 100644
--- a/XMonad/Util/Run.hs
+++ b/XMonad/Util/Run.hs
@@ -52,8 +52,8 @@ import Control.Monad
-- "XMonad.Util.Dzen"
-- | Returns the output.
-runProcessWithInput :: FilePath -> [String] -> String -> IO String
-runProcessWithInput cmd args input = do
+runProcessWithInput :: MonadIO m => FilePath -> [String] -> String -> m String
+runProcessWithInput cmd args input = io $ do
(pin, pout, perr, _) <- runInteractiveProcess cmd args Nothing Nothing
hPutStr pin input
hClose pin
@@ -65,8 +65,8 @@ runProcessWithInput cmd args input = do
return output
-- | Wait is in µs (microseconds)
-runProcessWithInputAndWait :: FilePath -> [String] -> String -> Int -> IO ()
-runProcessWithInputAndWait cmd args input timeout = do
+runProcessWithInputAndWait :: MonadIO m => FilePath -> [String] -> String -> Int -> m ()
+runProcessWithInputAndWait cmd args input timeout = io $ do
forkProcess $ do
(pin, pout, perr, _) <- runInteractiveProcess cmd args Nothing Nothing
hPutStr pin input
@@ -129,8 +129,8 @@ safeRunInTerm :: String -> String -> X ()
safeRunInTerm options command = asks (terminal . config) >>= \t -> safeSpawn t [options, " -e " ++ command]
-- | Launch an external application through the system shell and return a @Handle@ to its standard input.
-spawnPipe :: String -> IO Handle
-spawnPipe x = do
+spawnPipe :: MonadIO m => String -> m Handle
+spawnPipe x = io $ do
(rd, wr) <- createPipe
setFdOption wr CloseOnExec True
h <- fdToHandle wr