@hackage byline1.1.3
Library for creating command-line interfaces (colors, menus, etc.)
Categories
License
BSD-2-Clause
Maintainer
Peter Jones <pjones@devalot.com>
Links
Versions
Installation
Dependencies (12)
- ansi-terminal >=0.6 && <1.2
- attoparsec >=0.13 && <0.15
- base >=4.9 && <5.0
- colour ^>=2.3
- exceptions >=0.8 && <0.11
- free >=5.1 && <5.3 Show all…
Dependents (1)
@hackage/vimeta
Package Flags
build-examples
(off by default)
Build examples when building the library.
Byline
Byline simplifies writing interactive command-line applications by building upon ansi-terminal and haskeline. This makes it possible to print messages and prompts that include terminal escape sequences such as colors that are automatically disabled when standard input is a file. It also means that Byline works on both POSIX-compatible systems and on Windows.
The primary features of Byline include printing messages, prompting for input, and generating custom menus. It was inspired by the highline Ruby library and the terminal library by Craig Roche.
Example Using MonadByline
example :: MonadByline m => m Text
example = do
sayLn ("Hey, I like " <> ("Haskell" & fg magenta) <> "!")
let question =
"What's "
<> ("your" & bold)
<> " favorite "
<> ("language" & fg green & underline)
<> "? "
askLn question (Just "Haskell")
