readline-in-other-words: Readline effect for in-other-words.

[ bsd2, command-line, effect, haskeline, in-other-words, library, program, user-interfaces ] [ Propose Tags ]

This library provides effects for in-other-words offering the functionality of haskeline. Please see the README on GitHub at for more details.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],, (info)
Change log
Dependencies base (>=4.13 && <4.17), haskeline (>=0.8.1 && <0.8.3), in-other-words (>= && <, in-other-words-plugin (==, monad-control (>=1.0 && <1.1), mtl (>=2.2 && <2.3), readline-in-other-words [details]
License BSD-2-Clause
Copyright (c) 2021 Devin Lehmacher
Author Devin Lehmacher
Maintainer Devin Lehmacher
Category User Interfaces, Effect, in-other-words, Command Line
Home page
Bug tracker
Source repo head: git clone git://
this: git clone git://
Uploaded by lehmacdj at 2021-11-05T06:48:06Z
Executables echo-repl
Downloads 261 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-11-05 [all 1 reports]

Readme for readline-in-other-words-

[back to package description]


GitHub Actions Hackage

This package provides a few in-other-words effects that collectively provide the full functionality of haskeline. See Haskeline's documentation for additional usage information.

Example Usage

This is all it takes to write a miniature repl using this library:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}

module Main where

import Control.Effect
import Control.Effect.Readline

repl :: Effs '[Readline, HandleInterrupt] m => m ()
repl = handleInterrupt (outputStrLn "Interrupt!" *> repl) $
  withInterrupt $ do
    mline <- getInputLine "> "
    case mline of
      Nothing -> pure ()
      Just line -> outputStrLn line *> repl

main :: IO ()
main = runM $ runReadline defaultSettings repl

This will echo whatever text you write, and catches interrupts announcing that they occurred and preventing the program from terminating. This example is also available as the echo-repl target in examples/Echo.hs.


Bug reports and PRs are welcome.