aboutsummaryrefslogtreecommitdiffstats
path: root/WMonad.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WMonad.hs15
1 files changed, 3 insertions, 12 deletions
diff --git a/WMonad.hs b/WMonad.hs
index e6e3ae7..322f1f7 100644
--- a/WMonad.hs
+++ b/WMonad.hs
@@ -1,6 +1,6 @@
-----------------------------------------------------------------------------
-- |
--- Module : W.hs
+-- Module : WMonad.hs
-- Copyright : (c) Spencer Janssen 2007
-- License : BSD3-style (see LICENSE)
--
@@ -16,7 +16,7 @@
module WMonad (
W, WorkSpace, WState(..),
- runW, withDisplay, io, io_, forever, spawn, trace, whenJust
+ runW, withDisplay, io, spawn, trace, whenJust
) where
import StackSet (StackSet)
@@ -57,23 +57,14 @@ withDisplay f = gets display >>= f
io :: IO a -> W a
io = liftIO
--- | Lift an IO action into the W monad, discarding any result
-io_ :: IO a -> W ()
-io_ f = liftIO f >> return ()
-
--- | Run an action forever
-forever :: (Monad m) => m a -> m b
-forever a = a >> forever a
-
-- | spawn. Launch an external application
spawn :: String -> W ()
-spawn = io_ . runCommand
+spawn x = io (runCommand x) >> return ()
-- | Run a side effecting action with the current workspace. Like 'when' but
whenJust :: Maybe a -> (a -> W ()) -> W ()
whenJust mg f = maybe (return ()) f mg
-
-- | A 'trace' for the W monad. Logs a string to stderr. The result may
-- be found in your .xsession-errors file
trace :: String -> W ()