summaryrefslogtreecommitdiff
path: root/Assistant/Monad.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-30 17:14:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-30 17:14:51 -0400
commit4318f594d544320825093de8661ed1b40e4774d5 (patch)
tree709dcd2fe739c503651bc7bd5e1df35a52a27977 /Assistant/Monad.hs
parent07cd1b2b40735d460c8225762fcf3992b9886c60 (diff)
finished pushing Assistant monad into all relevant files
All temporary and old functions are removed.
Diffstat (limited to 'Assistant/Monad.hs')
-rw-r--r--Assistant/Monad.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Assistant/Monad.hs b/Assistant/Monad.hs
index 0dfd4e34d..fb4cb3340 100644
--- a/Assistant/Monad.hs
+++ b/Assistant/Monad.hs
@@ -17,6 +17,7 @@ module Assistant.Monad (
(<~>),
(<<~),
asIO,
+ asIO1,
asIO2,
) where
@@ -95,12 +96,16 @@ io <~> a = do
liftIO $ io $ runAssistant a d
{- Creates an IO action that will run an Assistant action when run. -}
-asIO :: (a -> Assistant b) -> Assistant (a -> IO b)
+asIO :: Assistant a -> Assistant (IO a)
asIO a = do
d <- reader id
+ return $ runAssistant a d
+
+asIO1 :: (a -> Assistant b) -> Assistant (a -> IO b)
+asIO1 a = do
+ d <- reader id
return $ \v -> runAssistant (a v) d
-{- Creates an IO action that will run an Assistant action when run. -}
asIO2 :: (a -> b -> Assistant c) -> Assistant (a -> b -> IO c)
asIO2 a = do
d <- reader id