cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Copyright | (c) Brent Yorgey 2009
License | BSD-like
Maintainer | cabal-devel@haskell.org
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Client.Init.Prompt

Description

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 #

Create a prompt with optional default value that returns a value of some Text instance.

promptYesNo #

Arguments

:: 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 #

Create a prompt with optional default value that returns a String.

promptList #

Arguments

:: 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 `other` option
-> m String |

Create a prompt from a list of strings