linenoise

A lightweight readline-replacement library for Haskell

https://github.com/ejconlon/haskell-linenoise#readme

Version on this page:0.3.2
LTS Haskell 20.26:0.3.2
Stackage Nightly 2022-11-17:0.3.2
Latest on Hackage:0.4.0

See all snapshots linenoise appears in

BSD-3-Clause licensed by Stephen Diehl, Eric Conlon
Maintained by [email protected]
This version can be pinned in stack with:linenoise-0.3.2@sha256:d7bb91cf43fc368731f9b77cba355d86bd6a2bb84572417803062eaabda155a2,2142

Module documentation for 0.3.2

Used by 2 packages in nightly-2021-08-15(full list with versions):

linenoise

CircleCI

A lightweight readline-replacement library for Haskell based on the linenoise library. (Not production ready!) See the demo app for usage, or see the climb library for higher-level building blocks for GHCi-like REPLs with colon-commands.

Differences from alternatives

  • haskeline
    • This uses FFI to a minimal C library vs pure Haskell
    • This uses standard MTL/Unlift typeclasses vs custom ones.
    • This does not require the use of a specific monad transformer.
  • readline
    • This offers a MonadIO/MonadUnliftIO interface vs raw IO.
    • This vendors and statically links its underlying library to simplify the build process.

License and attribution

This library includes the source code and license for linenoise in cbits. It is a fork of an older library with all licensing and attribution preserved.

Development workflow

This project uses stack to build.

The Makefile has a bunch of relevant phony targets for a development workflow including

  • build - Build the library and demo
  • download - Update vendored linenoise
  • demo - Run the demo app
  • deps - Install dev tools
  • lint - Lint with hlint
  • format - Format with stylish-haskell
  • docs - Generate docs

In addition, there are targets starting with ci that are invoked in various CI phases.

TODO

  • Support unicode (may involve vendoring a linenoise fork)
  • Verify that the FFI modifications for ByteString are memory-safe