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

Add MonadUnliftIO instance for InputT #131

Closed quickdudley closed 4 years ago

judah commented 4 years ago

Thank you for the patch. Unfortunately, I don't think it's feasible for us to support it at this time. Haskeline is a core dependency of GHC and included as part of its build. As a result, I tend to be pretty conservative about adding more dependencies to avoid increasing complexity in GHC. See in particular the recent effect of adding a dependency on exceptions: https://gitlab.haskell.org/ghc/ghc/issues/16752

As an alternative, we could consider developing a package with this change as an orphan instance. If that requires exposing InputT's constructor, maybe we could do so in a System.Console.Haskeline.Internal module, with a suitable warning about the API not being as stable. Let me know if you're interested in taking that on.

quickdudley commented 4 years ago

I'm willing to take that on.

infinity0 commented 4 years ago

An alternative to exposing the constructor is to just define askUnliftIO and withRunInIO here as top-level functions. The orphan instance definition in another package can then just re-use these functions.

judah commented 4 years ago

Thanks again for this improvement!