diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-03 13:53:38 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-03 13:53:38 +0200 |
| commit | a98cd5d87a0c7959146a8ca35aa40f42fc146ad8 (patch) | |
| tree | cb71228df517c0c639eb60042ce2972a80fc814e /src/Sequence/Utils.hs | |
| parent | 20f53cc1cb01b51bfecc3896c69e881dc72e6e05 (diff) | |
| download | 2017-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.hs | 4 |
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 | ||
| 52 | askBool :: String -> Bool -> Sh st Bool | 52 | askBool :: MonadIO m => String -> Bool -> m Bool |
| 53 | askBool prompt initial = askQ prompt $ fromMaybe initial . join . fmap (eval . CI.mk) | 53 | askBool 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 | ||
| 61 | askQ :: String -> (Maybe String -> a) -> Sh st a | 61 | askQ :: MonadIO m => String -> (Maybe String -> a) -> m a |
| 62 | askQ prompt eval = eval <$> liftIO (readline $ prompt ++ " ") | 62 | askQ prompt eval = eval <$> liftIO (readline $ prompt ++ " ") |
| 63 | 63 | ||
| 64 | unaligned = view faction' def | 64 | unaligned = view faction' def |
