Removes redundant putPrompt
function from Prompts module.
This commit is contained in:
parent
0acccae523
commit
2bd5a8fe1a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user