summaryrefslogtreecommitdiffhomepage
path: root/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Monitors/Common.hs')
-rw-r--r--Monitors/Common.hs7
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