-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to deal with new things added to Prelude in the future? #36
Comments
One possibility (which complements option 2 above) is to release a separate package called |
This is now an issue in practice. For GHC 8.2, I'm going to be adding I'm pretty tempted now to start |
@RyanGlScott My preferred solution would be to:
@ekmett already indicated that he could be "pretty easy to convince". |
I'm not sure we're talking about the same thing here. |
When I discussed with @ekmett to split e.g. Unfortunately, I don't have any solution to offer yet... :-/ |
@hvr summarizes my thoughts on the matter much better than I could. For those reasons, I'd prefer to keep the task of backporting Given that |
I'm 👍 for a new package, which would re-export
The clear difference to I'd use that package across "my" packages, e.g. |
That makes for a pretty clear mission statement and role in the community. |
@RyanGlScott asked me to write this long time ago, I apologize it took so long: I see two options to proceeed:
This is naming issue, i.e. do we want to have I personally prefer the We have brainstormed the names for alternatives with Ryan, and I think base-compat + base-compat-batteries
base-compat + base-compat-lite
So what you think, how we should the new package be? |
Notes about batteries package: Whatever will be decided above, I have few ideas for batteries package. The main observation is that same package is unlickely to depend on both I'd prefer that both package provide same modules, e.g. We also want bigger package to re-export identifiers from the smaller one, import "base-compat" Control.Monad.Compat
import "base-compat-lite" Control.Monad.Compat won't cause name clashes. |
(For the record, I'm not strongly leaning one way or the other at this point.) One thing to consider is that we're going to have to change something here, and given the significance of this milestone—to the point where One thing that we don't really have a strong feeling for at the moment is a consensus for what Perhaps what we need is an informal poll of some sort to gauge what folks desire here. I'm thinking of perhaps a blog post which has:
I don't really have the time to do this at the moment, alas. But getting feedback from a sizable amount of people (for some definition of "sizable") would be tremendously helpful here. |
Just as an update—I made significant progress on this last night, in the I went with the In that light, I think we should err on the side of least surprise and not add a bunch of dependencies to |
See #43. |
One small downside to exporting the exact same module name is then you're forced into a small dilemma. Do you put |
@ekmett note that e.g. Also, TBH, I very rarely |
That works great as long as you are in a cabal project. When you are just
playing around with standalone haskell files, you still have the issue.
…On Mon, Mar 26, 2018 at 3:50 AM, Oleg Grenrus ***@***.***> wrote:
@ekmett <https://github.com/ekmett> note that e.g. cabal repl hides all
non-direct dependencies.
Also, TBH, I very rarely import Prelude.Compat in GHCi, as I just use
latest GHC for interactive stuff.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASmEYn3NIRMJb49fpaXRP14pp2lVxj8ks5tiJ25gaJpZM4GkKol>
.
|
Admittedly, choosing identical module names does make certain things much more inconvenient. As @phadej notes, GHCi is not a use case I'm terribly concerned about, since (1) most folks don't reach for Making it harder to use Perhaps this is a sign that standalone Haskell scripts should always be using That being said, there are downsides to having different module names in tl;dr I'm somewhat reluctant to give up the sheer convenience that the current naming convention gives you. It can bite when you work out of a globally installed package database, but when working with |
After talking with @ekmett about this, we've struck a deal. To support the workflows of both library authors and folks who tinker with GHCi/write standalone scripts, a reasonable compromise is to provide versions of each module with a globally unique namespace. For instance, we currently have
I'll update #43 accordingly when I get a chance. |
👍 to re-exports |
This was an accidental oversight from an era in which base-orphans was more conservative about using language extensions. Now, we have no qualms about using language extensions, so let's just turn on -XScopedTypeVariables and do things exactly how base does them. Fixes haskell-compat#36.
A thought occurred to me when reading this thread about
MonadFail
. In upcoming releases of GHC, new things are going to be added to thePrelude
which haven't existed in GHC for very long.MonadFail
, for instance, will be added in GHC 8.8, and I believeSemigroup
will also make it in at some point.This poses an interesting design question for
base-compat
, because unlike other typeclasses which have been migrated toPrelude
(e.g.,Applicative
via the AMP),MonadFail
et al. are not available inbase
prior to 4.9. It seems that we'd have to do one of the following:base-compat
depend onsemigroups
/fail
/whatnot so thatSemigroup
/MonadFail
/etc. can be backported fromPrelude
properlybase-compat
any new dependencies. Instead, conditionally export things fromPrelude
based on what is available from a givenbase
releaseWhat are people's thought on this?
The text was updated successfully, but these errors were encountered: