summaryrefslogtreecommitdiffstats
path: root/Wm.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Wm.hs')
-rw-r--r--Wm.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Wm.hs b/Wm.hs
index c95648d..6b30ac1 100644
--- a/Wm.hs
+++ b/Wm.hs
@@ -33,9 +33,18 @@ newtype Wm a = Wm (StateT WmState IO a)
runWm :: Wm a -> WmState -> IO (a, WmState)
runWm (Wm m) = runStateT m
+--
+-- | Lift an IO action into the Wm monad
+--
io :: IO a -> Wm a
io = liftIO
+--
+-- | Lift an IO action into the Wm monad, discarding any result
+--
+io_ :: IO a -> Wm ()
+io_ f = liftIO f >> return ()
+
trace msg = io $ do
hPutStrLn stderr msg
hFlush stderr