summaryrefslogtreecommitdiffstats
path: root/Wm.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-07 04:21:39 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-07 04:21:39 +0100
commita0a1cfcf5d82c01738f0ca6f4e3c04dd8422a437 (patch)
tree8d7adeafd13e29b2735551f066428fa8e2cbb78a /Wm.hs
parentb01dc05c971408a6484bb347e4822880dae55db3 (diff)
downloadmetatile-a0a1cfcf5d82c01738f0ca6f4e3c04dd8422a437.tar
metatile-a0a1cfcf5d82c01738f0ca6f4e3c04dd8422a437.zip
comments for Main.hs, add io_, like io but return ()
darcs-hash:20070307032139-9c5c1-b063c7a18960d67fabf03d42b6b9d01a855c9cf5
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