I have the pleasure to announce that containers 2.0+alpha1 is being released.
containers is a modular, lightweight, and performant extension of the standard library. Version 2.0 introduces a monomorphic mode (thanks to @jpdeplaix) that is designed to prevent errors caused by the polymorphic “magic” operators such as (=). This breaking release is also the occasion to switch to dune, and to fix some inconsistencies in the API (mostly printers).
If you use containers, please give a try to 2.0+alpha1 and report any issue on the bucktracker!
opam suggests the new alpha version for an automatic upgrade of containers. is this intended? (rather than only testing with explicit opam pin for now?)
i tried a bit of updating of a project to 2.0. the monomorphic equality change requires some adjustments in quite a few places. i would do them for current projects but probably not for old projects. what’s a good way to keep old projects working without too much overhead when i need to go back to them in the future?
a brute-force solution would be a new package name containers2 but that seems like overkill. maybe there is some other way for me to keep my old projects working?
Well I don’t forget it, I don’t even think about it and it’s true I found a few != here and there in some code I wrote with colleagues. I didn’t git blame to see who was to be shouted at
But here all polymorphic operators are hidden so this not @@ ... precaution would not necessarily be needed any more.
Of course, writing combinators for negated functions is a problem.
The code changes still required for containers1 code are those for the labeled equality or comparison arguments in some functions. So even when foregoing the monomorphic operators, some manual work is still required in each source file to make a containers1 codebase work on containers2.
The alpha version is available through opam.
Just do opam upgrade containers if no installed packages rely on containers1.
Otherwise you will need to either install it on a new switch or remove/fix the packages that need containers1.