# \[ANN\] containers 3.0

**URL:** <https://discuss.ocaml.org/t/ann-containers-3-0/6194>\
**Category:** Ecosystem\
**Tags:** announce\
**Created:** [August 4, 2020, 1:46pm UTC](https://discuss.ocaml.org/t/ann-containers-3-0/6194 "2020-08-04T13:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![c-cube](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/c-cube/32/1727_2.png) [@c-cube](https://discuss.ocaml.org/u/c-cube)\
**Post date:** [August 4, 2020, 1:46pm UTC](https://discuss.ocaml.org/t/ann-containers-3-0/6194/1 "2020-08-04T13:46:07Z")

</div>

Dear y’all and all y’all’s,

I’m happy to announce, on behalf of containers’ contributors, the release of [containers 3.0](https://github.com/c-cube/ocaml-containers/releases/tag/v3.0). API documentation can be found [here](https://c-cube.github.io/ocaml-containers/3.0/).

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](https://github.com/FardaleM).

[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](https://github.com/c-cube/ocaml-containers/blob/master/README.md#to-30))

1. 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. the `CCSexp` module), it now lives in  
`containers` itself.
- if you used anything in `containers.data`, you need to depend on the  
`containers-data` package now.

1. Another large change is the removal (at last!) of functions deprecated  
in 2.8, related to the spread of `Seq.t` as the standard iterator type.  
Functions like `CCVector.of_seq` now operate on this standard `Seq.t` type,  
and old-time iteration based on [iter](https://github.com/c-cube/iter)  
is now named `of_iter`, `to_iter`, etc.

Here you need to change you code, possibly using search and replace.  
Thankfully, the typechecker should guide you.

1. `Array_slice` and `String.Sub` have been removed to simplify the  
code and `String` more lightweight. There is no replacement at the moment.  
Please tell us if you need this to be turned into a sub-library.

2. Renaming of some functions into more explicit/clear names.  
Examples:

- `CCVector.shrink` is now `CCVector.truncate`
- `CCVector.remove` is now `CCVector.remove_unordered`, to be  
contrasted with the new `CCVector.remove_and_shift`.
- `CCPair.map_fst` and `map_snd` now transform a tuple into another tuple  
by modify the first (resp. second) element.

1. All the collection pretty-printers now take their separator/start/stop  
optional arguments as `unit 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.

2. Removal of many deprecated functions.

---

<div class="post-metadata">

**Author:** ![orbitz](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/orbitz/32/110_2.png) [@orbitz](https://discuss.ocaml.org/u/orbitz)\
**Post date:** [August 4, 2020, 3:53pm UTC](https://discuss.ocaml.org/t/ann-containers-3-0/6194/2 "2020-08-04T15:53:10Z")

</div>

Awesome! Thank you, I’m a big user of containers and appreciate the hard work by everyone.
