aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.hs')
-rw-r--r--src/Utils.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Utils.hs b/src/Utils.hs
index 21ee67b..ec15405 100644
--- a/src/Utils.hs
+++ b/src/Utils.hs
@@ -6,24 +6,24 @@
module Utils where
-import Control.Monad ( liftM )
-import Data.Char ( toLower )
-import System.IO ( hFlush, stdout )
+import Control.Monad (liftM)
+import Data.Char (toLower)
+import System.IO (hFlush, stdout)
prompt :: String -> IO String
prompt banner = do
- putStr banner
- hFlush stdout
- getLine
+ putStr banner
+ hFlush stdout
+ getLine
promptYesNo :: String -> IO Bool
promptYesNo banner = do
- response <- liftM (map toLower) $ prompt banner
- if response `elem` yeses
- then return True
- else if response `elem` noes
- then return False
- else promptToContinue
+ response <- liftM (map toLower) $ prompt banner
+ if response `elem` yeses
+ then return True
+ else if response `elem` noes
+ then return False
+ else promptToContinue
where
yeses = ["y", "yes"]
noes = ["n", "no"]