repl-toolkit-1.1.0.0: Toolkit for quickly whipping up config files and command-line interfaces.

Safe HaskellNone
LanguageHaskell2010

System.REPL.Prompt

Contents

Description

Little helper functions for getting and putting lines.

This module re-exports part of Data.ListLike.IO, which contains names that clash with Prelude.

Synopsis

String-generic versions of Prelude Functions

putErr :: ListLikeIO full item => full -> IO () Source #

Prints a string to stderr.

putErrLn :: ListLikeIO full item => full -> IO () Source #

Prints a string, followed by a newline character, to stderr.

prompt :: (MonadIO m, ListLikeIO full item) => m full Source #

Prints > and asks the user to input a line.

Prompts

prompt' :: (MonadIO m, ListLikeIO full item, ListLikeIO full' item') => full -> m full' Source #

Prints its first argument and, in the same line, asks the user to input a line.

promptAbort :: (MonadIO m, ListLikeIO full item, ListLikeIO full' Char, MonadCatch m) => Char -> full -> m full' Source #

The same as prompt, but aborts as soon as the user presses a given key (commonly '\ESC'). This function temporarily tries to set the buffering mode to NoBuffering via hSetBuffering, which may not be supported. See the documentation of hSetBuffering for details.