Add explicit import of Monoid <> - #2278
Conversation
optparse-applicative 0.13.* no longer exports this.
ea7c2b1 to
2cff4bd
Compare
| (\sock -> do | ||
| setSocketOption sock ReuseAddr 1 | ||
| bindSocket sock (SockAddrInet port localhost) | ||
| bind sock (SockAddrInet port localhost) |
There was a problem hiding this comment.
This is completely unrelated, happy to leave out or create another PR
|
Not surprisingly the build broke due to the unused import warnings. Have used |
f512024 to
17ddc43
Compare
|
Hi, thanks for the report. How did you come across this issue? Were you trying to compile PureScript yourself with cabal-install? I'm open to alternative viewpoints here, but I think my preferred approach would be to not worry about whether PureScript builds with the latest versions of everything. Ideally everyone would use the exact same install plan; the more possible install plans there are, the more potential there is for problems, as different versions of dependencies could behave in different ways. We have had this kind of problem in the past, before we started using Stack everywhere — I think some people were seeing bugs that we weren't seeing because cabal-install had selected a different version of I think we should update |
|
On a different note, I think it would be nice to use an alternative Prelude which re-exports |
|
I agree that we should have a stackage snapshot under which PS fully builds and only make "guarantees" about that one, but I also think that we should make an effort to try and build with upstream versions greater than the snapshot specifies. This way we don't end up blocking any releases and provide valuable feedback to the upstream maintainers that we depend on so much. |
|
What releases might we be blocking by not doing that? |
|
I was thinking about stackage nightlies/lts versions in the sense that the latest nightly resolver might not include purescript at all because it has version conflicts |
|
Ah, right, yes. Even though purescript can be used as a library, I think it's really an application (at least, that is how it is used 99.9% of the time). I am beginning to wonder if it makes sense for purescript to be in stackage at all. |
|
We encourage people to install purescript via stack and the latest nightly resolver here: Being in stackage is valuable for PureScript since it's the most convenient way to actually notice breaking changes through upstream changes. Doesn't matter if it's a library or an executable, falling behind on dependency versions is never good. |
|
Yeah, we should change INSTALL.md; what it says on the website is much more likely to work: http://www.purescript.org/download/ I agree that we should try to stay up to date with dependency versions, but I worry that being on Stackage could encourage us to place staying up to date too high on our list of priorities. If new versions of things are released and we are breaking Stackage nightly, it's usually not feasible to just update and put a release out, since releases usually need coordination among things like core libraries, pursuit, docs, etc. See the Stackage policy; I don't think these timeframes are really doable for us. Wouldn't staying on the latest LTS snapshot more or less achieve the same? |
Exactly. We are (currently) building
Can't agree with this more. We have our own prelude, and it's enabled us to hide all the partial functions and support multiple versions of GHC with ease. In any case, let me know if there's anything you can do on this PR. I'll stay out of the stack discussion. :) |
Any experiments (eg. linting tools, things like the psc-ide) are likely going to be relying on the purescript package as a library; I'm sketching out a (single-purpose, experimental) linting tool that uses I think supporting the package-as-a-library it should stay as a "first-class" concern (completely aside from detecting compatibility breakages in Stackage or whatever) so as to keep it easy to experiment with.
Though it's convenient to lock some versions and otherwise throw open the others with If we want to bind ourselves to that, then great, but I really think this should be something to be made as a conscious choice, rather than something that happens to be easy, or because this one library breakage happens to tips us over into works-in-Stack / doesn't-work-in-Cabal territory. |
|
I'd rather import |
We /really/ should specify upper-bounds to all dependencies, and occasionally run There are benefits on staying on Stackage. It does help people to install
|
That's what the breakage in |
|
Yes, I'd rather |
|
Indeed. |
|
It did not seem right to continue to export a synonym for |
Hm, I'm not sure I agree with this. Is the set of constraints actually growing, other than in the sense that we very occasionally add dependencies? I'm not sure I'd describe our set of constraints as "custom", either, since it's just Stackage LTS snapshots, which do have a very large buy-in across the ecosystem; it's definitely not just us who are using them.
Sure, if there's anything making it difficult to do that kind of experiment I'd definitely want to know so that it can be fixed or mitigated. You have probably worked this out already but I'd recommend using the same snapshot as whichever version of
Perhaps not everyone will agree with me here but I don't think getting a copy of the
👍 I agree that the dependency constraints in our cabal file should reflect our knowledge as much as possible, and that it's better for cabal-install users to get solver errors rather than build failures. I don't think we should be lazy about the constraints in our cabal file just because Stack allows us to.
This is dangerous and I think we should avoid recommending it. This command will get you, in most cases, an install plan which nobody has ever run the tests against and which few other people are using. I'm planning to update The above is the best argument for taking PureScript out of Stackage, I think. People sensibly assume that
Maybe @paf31 can confirm or refute this, but I think a large part of the reason we wanted to standardise on one LTS snapshot (#1974) is to avoid this kind of work because of its (IMO) relatively low value-to-effort ratio. Finally, if we do want to immediately hear whenever purescript doesn't build with the latest versions of everything (even though it's still not clear to me what we really gain from this) I think we should do that with CI. We already have a GHC 8.0/nightly build, we just need to work out how to build with the latest nightly rather than what we currently have, which is the nightly from the last time the CI scripts were updated. I guess just using |
|
Sorry for the essay. I'm nearly done. I just wanted to suggest an alternative approach based on the above: immediately after each release, we update to the latest LTS snapshot. I think this is the right balance for us. It would give us plenty of time to test thoroughly with new versions of dependencies whenever we update. It would also mean we could just ignore nightly snapshots. If cabal-install users get build failures, we simply adjust the bounds in purescript.cabal so that they become solver failures. |
IMHO if people do
Yes, but as soon as
We are. The Travis CI change to use Another extreme is not to rely on "use Note: i'm not really proposing this, as it's a very dumb idea, but that's what use stack essentially is. Having single-major-version bounds ( |
I guess this is our fundamental disagreement: sometimes library maintainers mess up, and sometimes it's almost impossible to clearly delineate what counts as a bugfix or a semantic change. Ideally yes, we would trust the PVP contracts, but in practice I think purescript users are best served by us taking a more conservative approach here. Having said that, I totally agree about having our bounds reflect as much as possible of what we know about which versions of dependencies are ok and which are not.
The problem with this approach, though, is that we then have to choose between overly conservative upper bounds which forbid even (supposedly) non-breaking changes, or trusting the PVP. Choosing the former would mean we'd be perpetually behind in Stackage, and it probably would make experimental programs using
We have to make a trade-off between the amount of effort we put in and the value we get out. I'm sorry but I'm not prepared to go back to dealing with To me, given how much time maintainers are able to devote to PureScript, Travis cron jobs sound like too much effort to be worth doing too, unfortunately. I think we'd be much better served by putting that effort into PureScript in other ways, at least for the time being. Maybe one day there will be a PureScript foundation and people working on the language full-time, and then it would be a better option. :) |
|
If you don't want to specify upper-bounds, then please at least fix/add them after the fact. Currently bounds for FWIW: also |
|
What's the benefit of PureScript being in Stackage? It's so rarely used as a library, and people can add it to |
|
Is there something wrong with the Appveyor build? |
|
Looks like it timed out. I've restarted it. |
|
Is there anything code-related left to do here? |
|
I think the choices are:
I think the arguments on each side have been more or less completely covered above; at least, I don't have anything else to add. Sorry that it took such a massive amount of text to do it in, though. My preference would of course be the latter. |
|
Regardless of whether we stay in stackage denying a PR that will become a necessity when stackage updates |
Not from my perspective |
|
@kritzcreek it's just that I'd rather not set a precedent of trying to support lots of versions of things, since generally it's much, much simpler to stick to one LTS snapshot. The original PR was only a few lines; as we can see here, trying to support both makes it significantly larger. |
|
Making imports qualified/explicit is mandatory in PS because it leads to less fragile code. The fact that this PR allows our codebase to support both versions demonstrates that again. Lets use this PR to set a precedent, not of going out of our way to support multiple versions, but of being more explicit with our imports and reducing the fragility of our codebase. |
|
That's a very good point, I agree. |
|
Thanks @charleso! Let's move the Stackage discussion to an item in the Discussion milestone, yes? |
|
Sounds good to me. |
This patch can be removed when 0.10.0 is released. See purescript/purescript#2278. Same as upstream purescript/purescript@bdbf4e2 except that the change to the CONTRIBUTORS file has been removed since it did not apply cleanly.
This patch can be removed when 0.10.0 is released. See purescript/purescript#2278. Same as upstream purescript/purescript@bdbf4e2 except that the change to the CONTRIBUTORS file has been removed since it did not apply cleanly.

Apologies, I'm not quite sure what the best way to "fix" this.
optparse-applicative0.13.0.0 was just released and no longer exports<>, which breaks the cabal build.The problem with the change as it stands is that there are now warnings about redundant imports of
Data.Monoidfor OPA 0.12.*. Alternatively an upper bounds on OPA could be added. Either that or CCP ifs around the imports. Happy to make whatever change people recommend.https://github.com/pcapriotti/optparse-applicative/pull/216/files#diff-4191720afbea61cacc0c18ca54118978L52