console-prompt-0.1: console user prompts

Safe HaskellSafe
LanguageHaskell2010

System.IO.Prompt

Synopsis

Documentation

prompt Source #

Arguments

:: String

The prompt to display

-> IO String 

Prompts the user for a string

promptWith Source #

Arguments

:: (String -> a)

The conversion function

-> String

The prompt to display

-> IO a 

Prompts the user and converts the value to a specific type

promptWithMaybe Source #

Arguments

:: (String -> Maybe a)

The conversion function (returns nothing on failure)

-> String

The prompt to display

-> String

The error message to display on failure

-> IO a 

Prompts the user and converts the value to a specific type with a possibility of failing with a single error message, repeating until a valid entry is given

promptWithEither Source #

Arguments

:: (String -> Either String a)

The conversion function (returns the error message on failure)

-> String

The prompt to display

-> IO a 

Prompts the user and converts the value to a specific type with a possibility of failing with multiple error messages, repeating until a valid entry is given

charPrompt Source #

Arguments

:: String

The prompt to display

-> IO Char 

Prmopts the user for a single character

charPromptWith Source #

Arguments

:: (Char -> a)

The conversion function

-> String

The prompt to display

-> IO a 

Prompts the user for a character and converts the value to a specific type

charPromptWithMaybe Source #

Arguments

:: (Char -> Maybe a)

The conversion function (returns nothing on failure)

-> String

The prompt to display

-> String

The error message to display on failure

-> IO a 

Prompts the user for a character and converts the value to a specific type with a possibility of failing with a single error message, repeating until a valid entry is given

charPromptWithEither Source #

Arguments

:: (Char -> Either String a)

The conversion function (returns the error message on failure)

-> String

The prompt to display

-> IO a 

Prompts the user for a character and converts the value to a specific type with a possibility of failing with multiple error messages, repeating until a valid entry is given