Dear y’all and all y’all’s,
I’m happy to announce, on behalf of containers’ contributors, the release of containers 3.0. API documentation can be found here.
Containers is a BSD-licensed standard library extension [1] that aims at being lightweight, convenient, modular, portable, and only pay for what you use; that includes compatibility with OCaml >= 4.03. This is the second major update in 7 years of existence, following semantic versioning.
Release 3.0 was the opportunity to clean up some inconsistencies (in printers, among others), to focus on the standard Seq.t
type, and to split some sub-libraries into their own packages (containers-thread
and containers-data
respectively). The hope is that the new version is more consistent, lightweight, and pleasant to use.
I want to thank all contributors for their hard work, and in particular Fardale.
[1]: as in, containers extends the stdlib and does not intend to replace it.
Overview of breaking changes
(this is extracted from the readme’s migration section)
- The biggest change is that some sub-libraries have been either turned into
their own packages (containers-thread
,containers-data
),
deleted (containers.iter
),or merged elsewhere (containers.sexp
).
This means that if use these libraries you will have to edit your
dune
/_oasis
/opam
files.
- if you use
containers.sexp
(i.e. theCCSexp
module), it now lives in
containers
itself. - if you used anything in
containers.data
, you need to depend on the
containers-data
package now.
- Another large change is the removal (at last!) of functions deprecated
in 2.8, related to the spread ofSeq.t
as the standard iterator type.
Functions likeCCVector.of_seq
now operate on this standardSeq.t
type,
and old-time iteration based on iter
is now namedof_iter
,to_iter
, etc.
Here you need to change you code, possibly using search and replace.
Thankfully, the typechecker should guide you.
-
Array_slice
andString.Sub
have been removed to simplify the
code andString
more lightweight. There is no replacement at the moment.
Please tell us if you need this to be turned into a sub-library. -
Renaming of some functions into more explicit/clear names.
Examples:
-
CCVector.shrink
is nowCCVector.truncate
-
CCVector.remove
is nowCCVector.remove_unordered
, to be
contrasted with the newCCVector.remove_and_shift
. -
CCPair.map_fst
andmap_snd
now transform a tuple into another tuple
by modify the first (resp. second) element.
-
All the collection pretty-printers now take their separator/start/stop
optional arguments asunit printer
(i.e.Format.formatter -> unit -> unit
functions) rather than strings. This gives the caller better control
over the formatting of lists, arrays, queues, tables, etc. -
Removal of many deprecated functions.