simple-prompt: Simple commandline text prompt functions

[ bsd3, library, system ] [ Propose Tags ]

The library provides prompt functions for reading user input: for example prompt returns the input given, promptEnter expects only Enter, and yesNo asks for confirmation.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.1.0, 0.2.0,, 0.2.1, 0.2.2 (info)
Change log
Dependencies base (<5), exceptions, extra, haskeline (>0.8), time [details]
License BSD-3-Clause
Copyright 2023 Jens Petersen <>
Author Jens Petersen <>
Maintainer Jens Petersen <>
Category System
Home page
Bug tracker
Source repo head: git clone
Uploaded by JensPetersen at 2023-10-27T10:01:28Z
Distributions Fedora:, LTSHaskell:0.2.2, NixOS:0.2.2, Stackage:0.2.2
Downloads 307 total (35 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-10-27 [all 1 reports]

Readme for simple-prompt-0.2.2

[back to package description]


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.