Blog
The OCaml Planet RSS
Articles and videos contributed by both experts, companies and passionate developers from the OCaml community. From in-depth technical articles, project highlights, community news, or insights into Open Source projects, the OCaml Planet RSS feed aggregator has something for everyone.
Want your Blog Posts or Videos to Show Here?
To contribute a blog post, or add your RSS feed, check out the Contributing Guide on GitHub.
When I started to play with OCaml I was kind of surprised that there was no id (identity) function that was available out-of-box (in Stdlib module, that’s auto-opened). A quick search lead me to the Fun module, which is part of the standard library and is nested under Stdlib. It was introduced in OCaml 4.08, alongside other modules such as Int, Result and Option.1 It was part of some broader efforts to slim down Stdlib and move in the direction of a more modular standard library. ↩
Today I’m going to cover a very basic topic - conversions between OCaml’s primary numeric types int and float. I guess most of you are wondering if such a basic topic deserves a special treatment, but if you read on I promise that it will be worth it.
Jon asked me to make a Docker image that contains OxCaml ready to run without the need to build it from scratch.
I am grateful for Tarides’ sponsorship of my OCaml work. Below is a summary of my activities in Q2 2025.
```diff @@ -44,6 +44,8 @@ # the lines involved in the conflict, which is arguably worse #/Changes merge=union
Earlier this year, I returned to the Computer Laboratory at the University of Cambridge, as part of the Energy and Environment Group, combining with my work at Tarides. It’s been something of a whirlwind, which doesn’t look like it’ll be abating just yet, but there’s still been the odd chance to consider where things are and where we might be headed. I’m minded of a scene from an opera I performed a few years ago in Hannover. In the second act of Henrico Leone (🦁, rather than 🐫, but hey), Henrico’s wife, Metilda, in a vision sees her husband defeated in battle:
Thanks to some targetted optimisations in the script which manages Relocatable OCaml’s various branches, I’d vastly improved the turn-around time when making changes to the patch-set and propagating them through the various tests and backports. On Tuesday night, the entire set of branches was green in CI (they’re sat here with green check marks and everything). All that was to be needed on Wednesday was to quickly update the opam packaging to take advantage of Relocatable-awesomeness and plumb it all together. The 2022 version of the packages for Ljubljana I knew contained a hack for searching a previous switch, but I’d already investigated a more principled approach using opam’s build-id variable, so it would just be a matter of plumbing that in and using the cloning mechanism already in that script.