I’m trying to upgrade core to v0.15.0 today and ran into issues with breaking API changes.
Specifically, the Core.Map.Tree module seems to be gone (is this documented anywhere?). I saw there’s this new Core.Map.Make_tree functor introduced, but I was unable to find any documentations or examples on how it is intended to be used.
For example, say we have this old code that uses core.v0.14.0:
Yes, the Tree module was removed from the main functor signatures due to being rarely used and contributing to generating extremely large modules in compiled binaries. You can use Make_tree like you’ve seen, or you can use the Map.Tree module directly.
Make_tree_plain is defined to return a module whose signature is Make_S_plain_tree(Key).S, so you can do something like:
module AMapTree : Make_S_plain_tree(A).S
I don’t think we have specific documentation for this, but Map.Tree’s interface will be similar to AMapTree’s, except that you will have to pass in the comparator manually at each callsite that needs it.
Thanks for the feedback. While we typically try to announce any significant breaking changes, we often miss or omit changes that we expect will not affect any external users. (For example we sometimes search GitHub and other public OCaml code to see if there are any callsites of things we think are more or less unused outside of JS).
I’m guessing in this case that we just thought nobody would be using Tree (in any of its versions) outside of Jane Street, since it’s a pretty specialized module and not a super friendly API.