summaryrefslogtreecommitdiff
path: root/src/Sequence/Utils.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-03 13:53:38 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-03 13:53:38 +0200
commita98cd5d87a0c7959146a8ca35aa40f42fc146ad8 (patch)
treecb71228df517c0c639eb60042ce2972a80fc814e /src/Sequence/Utils.hs
parent20f53cc1cb01b51bfecc3896c69e881dc72e6e05 (diff)
download2017-01-16_17:13:37-a98cd5d87a0c7959146a8ca35aa40f42fc146ad8.tar
2017-01-16_17:13:37-a98cd5d87a0c7959146a8ca35aa40f42fc146ad8.tar.gz
2017-01-16_17:13:37-a98cd5d87a0c7959146a8ca35aa40f42fc146ad8.tar.bz2
2017-01-16_17:13:37-a98cd5d87a0c7959146a8ca35aa40f42fc146ad8.tar.xz
2017-01-16_17:13:37-a98cd5d87a0c7959146a8ca35aa40f42fc146ad8.zip
probibilistic computations
Diffstat (limited to 'src/Sequence/Utils.hs')
-rw-r--r--src/Sequence/Utils.hs4
1 files changed, 2 insertions, 2 deletions
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
49 Nothing -> shellPutErrLn $ "Currently not focusing any entity" 49 Nothing -> shellPutErrLn $ "Currently not focusing any entity"
50 Just id -> f id 50 Just id -> f id
51 51
52askBool :: String -> Bool -> Sh st Bool 52askBool :: MonadIO m => String -> Bool -> m Bool
53askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . CI.mk) 53askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . CI.mk)
54 where 54 where
55 eval "yes" = Just True 55 eval "yes" = Just True
@@ -58,7 +58,7 @@ askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . C
58 eval "n" = Just False 58 eval "n" = Just False
59 eval _ = Nothing 59 eval _ = Nothing
60 60
61askQ :: String -> (Maybe String -> a) -> Sh st a 61askQ :: MonadIO m => String -> (Maybe String -> a) -> m a
62askQ prompt eval = eval <$> liftIO (readline $ prompt ++ " ") 62askQ prompt eval = eval <$> liftIO (readline $ prompt ++ " ")
63 63
64unaligned = view faction' def 64unaligned = view faction' def