diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-08 12:01:20 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-08 12:01:20 +0200 |
commit | 6d2519cb84ebd56a7b270bc58b4e352b291624f6 (patch) | |
tree | 3854257e5998ffc37398328bd301aae8af78a927 /Monitors/Common.hs | |
parent | c733fb4a4069fa8b41901a9763cbd1769c548517 (diff) | |
download | xmobar-6d2519cb84ebd56a7b270bc58b4e352b291624f6.tar.gz xmobar-6d2519cb84ebd56a7b270bc58b4e352b291624f6.tar.bz2 |
added runM to run monitors internally
darcs-hash:20070708100120-d6583-1db3f135af0e31652c0f62f974f8f52f9845ea18.gz
Diffstat (limited to 'Monitors/Common.hs')
-rw-r--r-- | Monitors/Common.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Monitors/Common.hs b/Monitors/Common.hs index c53d1f6..e4c1562 100644 --- a/Monitors/Common.hs +++ b/Monitors/Common.hs @@ -21,6 +21,7 @@ module Monitors.Common ( , setConfigValue , getConfigValue , runMonitor + , runM , io -- * Parsers -- $parsers @@ -172,6 +173,12 @@ runMonitor conf actionFail action = let ac = doArgs args actionFail action putStrLn =<< runReaderT ac c +runM :: [String] -> IO MConfig -> Monitor String -> ([String] -> Monitor String) -> IO String +runM args conf actionFail action = + do c <- conf + let ac = doArgs args actionFail action + runReaderT ac c + io :: IO a -> Monitor a io = liftIO |