This version can be pinned in stack with:simple-prompt-0.2.4@sha256:9b2fa4fd66666b67231176896e2d2448491a4fa60bd13003f2733ff0e9d9f1e7,2205
Module documentation for 0.2.4
simple-prompt
A simple commandline text prompt library for user input.
The SimplePrompt module provides:
prompt: returns a string
promptNonEmpty prompts for non-empty string
promptInitial with pre-filled initial input
promptPassword prompts for password
promptChar prompts for a character
promptKeyPress waits for a key press
promptEnter waits for Enter key
yesNo expects y/n answer
yesNoDefault [y/N] or [Y/n]
It uses haskeline to read the input.
The SimplePrompt.Internal module provides lower-level access to
functional haskeline InputT monad transformer-based prompt functions:
runPrompt, getPrompt*
untilInput, mapInput, clearedInput, nonEmptyInput.
Usage examples
Since it basically runs in the IO monad usage is pretty simple.
For explicit examples search for import SimplePrompt in consumer packages:
dl-fedora, fbrnch, hkgr, rhbzquery, select-rpms, stack-clean-old
Revision history for simple-prompt
0.2.4 (2025-12-28)
- yesNo[Default]: only append “?” if missing
0.2.3 (2024-06-13)
- getGenericPrompt: adapt prompt suffix for final newline or colon
- clearedInput no longer prints short duration for any buffered input
0.2.2 (2023-10-27)
0.2.1 (2023-08-09)
- do not trim spaces for yesNo and yesNoDefault
- Internal: timedInput renamed to clearedInput
0.2.0 (2023-05-28)
- new API using haskeline and MonadIO
- prompt ignores buffered stdin lines if it returns in milliseconds
- promptEnter replaces prompt_
- new functions: promptEnter, promptInitial, promptNonEmpty, promptPassword
- yesNo and yesNoDefault replace yesno
- internal haskeline functions in SimplePrompt.Internal: including
getPrompt*, runPrompt, untilInput, mapInput, nonEmptyInput, timedInput
0.1.0 (2023-04-02)
- initial release with prompt, prompt_, yesno functions