Skip to content

Conversation

quickdudley
Copy link
Contributor

No description provided.

@judah
Copy link
Collaborator

judah commented Jan 5, 2020

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
Copy link
Contributor Author

I'm willing to take that on.

@infinity0
Copy link

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.

Copy link
Collaborator

@judah judah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for following up on this (and to @infinity0 for the suggestion)! This change looks good to me; I just have one small request for the documentation.

mfix f = InputT (mfix (unInputT . f))

-- | Run an action in the underlying monad with a function for restoring the
-- current 'InputT' context.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we elaborate the comment a little more, indicating that it's intended for use with other monad transformer stacks? Maybe even call out the unliftio package explicitly as an example?

@judah
Copy link
Collaborator

judah commented Jul 1, 2020

Thanks again for this improvement!

@judah judah merged commit 5f16b76 into haskell:master Jul 1, 2020
aryairani pushed a commit to unisonweb/haskeline that referenced this pull request Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants