New release of baby

Hello,

It is my pleasure to announce the second release of baby.

  opam update
  opam install baby.20241204

baby is an OCaml library that offers persistent sets and maps based on balanced binary search trees. It offers replacements for OCaml’s Set and Map modules.

Height-balanced and weight-balanced binary search trees are offered out of the box. Furthermore, to advanced users, the library offers a lightweight way of implementing other balancing strategies.

Documentation is available online.

The changes in this release are as follows:

  • The library now offers both sets and maps. The modules Baby.H.Set and Baby.W.Set continue to exist, and are compatible with OCaml’s Set library. The modules Baby.H.Map and Baby.W.Map appear, and are compatible with OCaml’s Map library. Furthermore, the functors Baby.H.Make and Baby.W.Make appear. These functors produce a module that contains sets, maps, and two conversion functions between sets and maps, namely domain and lift.

  • Documentation: in the signature OrderedType, clarify the specification of the function compare; this function decides a total preorder .

  • Documentation: in the preamble, clarify that, most of the time, we assume that is a total order; if an operation must be understood in the more general case where is a total preorder, then this is explicitly indicated.

  • Documentation: update the documentation of find and find_opt in accordance with the previous point.

  • A number of incompatible changes have been made; see the change log for details.

5 Likes

What does “persistent” refer to here? Because I would not call OCaml’s Hash and Map modules persistent.

I would guess persistent is the same as immutable, Map is persisent but Hash is not (this post does not mention hash though)

1 Like

I suspect as much; persistent for me refers to some file-based persistency - hence the question.

That the annoying side effect of human languages being so overloaded…
This usage of persistent in the context of data structure is also a common one, e.g. Persistent data structure - Wikipedia

1 Like

Yes, by “persistent”, I meant “immutable”. I will clarify; thanks for pointing out a possible confusion.

2 Likes