Copyright | (c) Brent Yorgey 2009 |
---|---|
License | BSD-like |
Maintainer | cabal-devel@haskell.org |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
User prompt utility functions for use by the 'cabal init' command.
Synopsis
- prompt :: (Interactive m, Parsec t, Pretty t) => String -> DefaultPrompt t -> m t
- promptYesNo :: Interactive m => String -> DefaultPrompt Bool -> m Bool
- promptStr :: Interactive m => String -> DefaultPrompt String -> m String
- promptList :: Interactive m => String -> [String] -> DefaultPrompt String -> Maybe (String -> String) -> Bool -> m String
Documentation
prompt :: (Interactive m, Parsec t, Pretty t) => String -> DefaultPrompt t -> m t Source #
Create a prompt with optional default value that returns a value of some Text instance.
:: Interactive m | |
=> String | prompt message |
-> DefaultPrompt Bool | optional default value |
-> m Bool |
Create a yes/no prompt with optional default value.
promptStr :: Interactive m => String -> DefaultPrompt String -> m String Source #
Create a prompt with optional default value that returns a String.
:: Interactive m | |
=> String | prompt |
-> [String] | choices |
-> DefaultPrompt String | optional default value |
-> Maybe (String -> String) | modify the default value to present in-prompt e.g. empty string maps to "(none)", but only in the prompt. |
-> Bool | whether to allow an |
-> m String |
Create a prompt from a list of strings