-
Notifications
You must be signed in to change notification settings - Fork 247
Backward compatibility with v1.7.1/2 for the IO Monad #2125
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
Conversation
For backwards compatibility. This allows Agda developments that use monads to be made to work with both v1.7 and v2.0 of the standard library.
I thought that the point of v2.0 was that we were happy to break backwards compatibility more aggressively? Also, if this does get in then |
And... the whole point of the breaking change to remove the top-level namespace entry So I would be strongly against this merge, FWIW. |
Can the definitions of |
@jamesmckinna wrote:
The problem is that v1.7 does not expect such fields here in a @jamesmckinna wrote:
Ah, sorry, I was not aware of such plans. Currently, @gallais wrote:
I added a deprecation warning. |
|
@andreasabel wrote:
Yes, I see. But I think the suggestion might (?) still work, even with the |
Yes, as @gallais and @jamesmckinna have identified, this is the crux of the problem. We've taken the decision not to preserve backwards compatibility with the 2.0 release. What reason do you need for working both with |
@jamesmckinna wrote:
Thanks for the hint. I tried it out. I got unsolved metas because these defs are polymorphic. But even if I could solve this problem, there would still be the problem that an alias |
On a more general note, my goal is to develop such that:
Unfortunately, Agda does not natively understand CPP; that's the technique used in GHC Haskell to support different API versions. I also lacks good support for dependency versioning (like Cabal's So far, I have been relying on the backwards compatibility of the std-lib. Things have not been removed from one release to the next, but just deprecated. Then, after the release, one can fix the deprecation warnings to again get something that works with the latest release and the master. In the current gap between v1.7 and master I have to either use CPP or fork my project. I think you must have discussed this scenario; do you have some advise how to proceed here? In the present situation, because Agda 2.6.4 also works with 1.7.1/2, I could postpone updating my project to the next std-lib, but in general, there could be a problem... |
@jamesmckinna wrote:
It seems like if v2.0 does not aim to populate the |
Have you tried the suggestion proposed in #2124 (comment)? |
Making 1.7 forward compatible is of course another alternative, that would mean adding Btw, I just released Agda 2.6.4! |
Ah... there really seems to be no good solution without, in some way, interpolating @gallais 's hypothetical "v1.8" or "v1.7.3". Maddening! Or else, craving your indulgence to accept a breaking change, this one time. I understand the desire to maintain a 'smooth'/'progressive' upgrade/deprecation path (and v2.0 incorporates many such detours where it has been possible), but v2.0 has so many changes over v1.7.* that I think we would like users to accept... the break. Shout-outs to @gallais and @MatthewDaggitt ... I am a still |
Of course, we haven't consider forward compatibility before, I'm a drowning man clutching at anything that floats by, while trying to defend breaking changes that required quite some effort to achieve (and which I have already rolled back on once already, again on request from you). If we were to consider it as policy, then I could imagine that would/might open a world of pain in respect of any particular development which some user or other wishes to maintain. Your situation in that regard is somewhat different... ;-) I am not, nor I think could be, any (final) arbiter in this. |
FWIW, stdlib 2.0 is backwards-incompatible in many different ways in addition to declaring some definitions as deprecated. If I understand correctly, the hierarchy of quite some modules is reorganized with exports being moved around; some definitions change implicit arguments to explicit; some definitions have different implementation so their proofs have to change, etc. |
Closing as superseded by #2141 |
return
fromIO.Primitive
#2124:IO.Primitive.return
(alias forpure
) for backwards compatThese patches allow me to port an Agda development using v1.7.1 to v2.0 (current
master
).The code I want to have working with both version uses
do
for theIO
monad andmapM
.So I am using the
module
based technique to bring>>=
into scope for thedo
notation.Previously (v1.7), I defined
IOMonad
like this:This definition was good enough to form
record {IOMonad}
for the instantiation ofTraversableM
.With v2.0, forming a
RawMonad
also needs embedded instances ofRawFunctor
andRawApplicative
.I managed to make the definition of
IOMonad
compatible with v2.0 by changing it to be the following:This works with 1.7.1/2. To have it work with 2.0 as well, the present PR is needed, because:
return
fromIO.Primitive
.Raw*
fromCategory.*
(for*
in {Functor
,Applicative
}).