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.
Feedback on this post is welcomed on Discuss! We are extremely happy to announce the release of opam 2.4.0 and encourage all users to upgrade. Please read on for installation and upgrade instructions. Major changes On opam init the compiler chosen for the default switch will no longer be ocaml-syste...
Would you like to build every package in opam in a single Dockerfile using BuildKit?
Over the last few months, I have written several posts on the package installation graphs specifically, Topological Sort of Packages, Installation order for opam packages and Transitive Reduction of Package Graph. In this post, I’d like to cover a alternative ordering solution.
One of the first things developers want to do in any language is print out the value of a variable. In languages with dynamic typing or extensive reflection, this is often a trivial, built-in operation. In OCaml, the story is a bit different. Its strong, static type system requires you to be explicit about how to turn a data structure into a string representation. There is no universal print or console.log that works on any type.
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.



