From 6d2519cb84ebd56a7b270bc58b4e352b291624f6 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sun, 8 Jul 2007 12:01:20 +0200 Subject: added runM to run monitors internally darcs-hash:20070708100120-d6583-1db3f135af0e31652c0f62f974f8f52f9845ea18.gz --- Monitors/Common.hs | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3