Removes redundant putPrompt function from Prompts module.

This commit is contained in:
Arjun Kathuria 2022-07-10 09:45:39 +05:30
parent 0acccae523
commit 2bd5a8fe1a

View File

@ -12,19 +12,16 @@ import Control.Monad.Reader
import qualified Data.Text.IO as TIO
import GHCup.Prelude.Logger
import GHCup.Types.Optics
putPrompt :: (HasLog env, MonadReader env m, MonadIO m)
=> PromptQuestion
-> m ()
putPrompt = logInfo
import GHCup.Types (PromptQuestion, PromptResponse(..))
getUserPromptResponse :: ( HasLog env
, MonadReader env m
, MonadIO m)
=> PromptQuestion
-> m PromptResponse
getUserPromptResponse prompt = do
putPrompt prompt
logInfo prompt
resp <- liftIO TIO.getLine
if resp `elem` ["YES", "yes", "y", "Y"]
then pure PromptYes