From f2d3bad664167346c048285bb2cd6d69608211a5 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Fri, 9 Mar 2007 07:01:39 +0100 Subject: -12 lines, refactor darcs-hash:20070309060139-9c5c1-451727d42c18072aaaf9224074b7225165d40713.gz --- WMonad.hs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'WMonad.hs') 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 () -- cgit v1.2.3