From a98cd5d87a0c7959146a8ca35aa40f42fc146ad8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 3 Jun 2016 13:53:38 +0200 Subject: probibilistic computations --- src/Sequence/Utils.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Sequence/Utils.hs') diff --git a/src/Sequence/Utils.hs b/src/Sequence/Utils.hs index 32f8239..f0a8849 100644 --- a/src/Sequence/Utils.hs +++ b/src/Sequence/Utils.hs @@ -49,7 +49,7 @@ withFocus f = use gFocus >>= \focus -> case focus of Nothing -> shellPutErrLn $ "Currently not focusing any entity" Just id -> f id -askBool :: String -> Bool -> Sh st Bool +askBool :: MonadIO m => String -> Bool -> m Bool askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . CI.mk) where eval "yes" = Just True @@ -58,7 +58,7 @@ askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . C eval "n" = Just False eval _ = Nothing -askQ :: String -> (Maybe String -> a) -> Sh st a +askQ :: MonadIO m => String -> (Maybe String -> a) -> m a askQ prompt eval = eval <$> liftIO (readline $ prompt ++ " ") unaligned = view faction' def -- cgit v1.2.3