haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

`getExternalPrint` is very inconvenient to use when you have ByteString or similar non-String data #124

Open merijn opened 4 years ago

merijn commented 4 years ago

I'm using both Haskeline and monad-logger and tryin to make my stderr logging play nice with line input, as right now log messages clobber my prompt. Unfortunately, monad-logger deals with ByteString and the function returned by getExternalPrint only accepts String. Having monad-logger first build a ByteString each time, and then having to decode + unpack before being able to print is rather inconvenient. Would it be possible to add/extend Haskeline with a way to dump out ByteString directly?

Since Haskeline already has a dependency on ByteString this doesn't seem like it'd expand the dependency footprint any.