Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
System.IO.Prompt
- prompt :: String -> IO String
- promptWith :: (String -> a) -> String -> IO a
- promptWithMaybe :: (String -> Maybe a) -> String -> String -> IO a
- promptWithEither :: (String -> Either String a) -> String -> IO a
- charPrompt :: String -> IO Char
- charPromptWith :: (Char -> a) -> String -> IO a
- charPromptWithMaybe :: (Char -> Maybe a) -> String -> String -> IO a
- charPromptWithEither :: (Char -> Either String a) -> String -> IO a
Documentation
Prompts the user and converts the value to a specific type
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
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
Prmopts the user for a single character
Prompts the user for a character and converts the value to a specific type
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
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