| CARVIEW |
byline: Library for creating command-line interfaces (colors, menus, etc.)
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 setting text 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
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")
[Skip to Readme]
Modules
[Index] [Quick Jump]
- Byline
- Byline.Completion
- Byline.Exit
- Internal
- Byline.Internal.Color
- Byline.Internal.Completion
- Byline.Internal.Eval
- Byline.Internal.Prim
- Byline.Internal.Simulation
- Byline.Internal.Stylized
- Byline.Internal.Types
- Byline.Menu
- Byline.Shell
- Byline.Simulation
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| build-examples | Build examples when building the library. | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- byline-1.1.3.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0, 0.2.4.0, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.2.1, 0.4.0.0, 1.0.0.0, 1.1.0.0, 1.1.0.1, 1.1.1, 1.1.2, 1.1.3 (info) |
|---|---|
| Change log | CHANGES.md |
| Dependencies | ansi-terminal (>=0.6 && <1.2), attoparsec (>=0.13 && <0.15), base (>=4.9 && <5.0), byline, colour (>=2.3 && <2.4), exceptions (>=0.8 && <0.11), free (>=5.1 && <5.3), haskeline (>=0.8 && <0.8.4), mtl (>=2.1 && <2.4), optparse-applicative (>=0.18 && <0.19), relude (>=0.6 && <1.3), terminfo-hs (>=0.1 && <0.3), text (>=0.11 && <2.2) [details] |
| Tested with | ghc ==9.6 || ==9.8 || ==9.10 |
| License | BSD-2-Clause |
| Copyright | Copyright: (c) 2015-2025 Peter J. Jones |
| Author | Peter Jones <pjones@devalot.com> |
| Maintainer | Peter Jones <pjones@devalot.com> |
| Uploaded | by PeterJones at 2025-02-17T16:06:23Z |
| Category | System, User Interfaces |
| Home page | https://github.com/pjones/byline |
| Bug tracker | https://github.com/pjones/byline/issues |
| Source repo | head: git clone https://github.com/pjones/byline.git |
| Distributions | NixOS:1.1.3 |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Executables | colors, shell, menu, simple, demo |
| Downloads | 8839 total (57 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2025-02-17 [all 1 reports] |
Readme for byline-1.1.3
[back to package description]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")
