Safe Haskell | None |
---|---|
Language | Haskell2010 |
Little helper functions for getting and putting lines.
This module re-exports part of Data.ListLike.IO, which contains names that clash with Prelude.
- module Data.ListLike.IO
- putErr :: ListLikeIO full item => full -> IO ()
- putErrLn :: ListLikeIO full item => full -> IO ()
- prompt :: (MonadIO m, ListLikeIO full item) => m full
- prompt' :: (MonadIO m, ListLikeIO full item, ListLikeIO full' item') => full -> m full'
- promptAbort :: (MonadIO m, ListLikeIO full item, ListLikeIO full' Char, MonadCatch m) => Char -> full -> m full'
String-generic versions of Prelude Functions
module Data.ListLike.IO
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.