Hello, my name is Xavier Van de Woestyne, and you've landed on the index of my personal website (though it doesn't deal much with personal things, so it's fine). This page is an English-language summary of my personal website (written in French); it essentially follows the structure of a traditional blog.
Index
You can find me on Mastodon, on Github, on X/Twitter, on BlueSky (or elsewhere (FR)) and, in the real-life, in Nantes, Sometimes in Bruxelles and from time to time in Paris. If you read French, feel free to visit my French-language page (which is more complete).
Essays and ramblings
Here is a list of articles/translations on various subjects, such as OCaml.
-
OCaml, modules, and import schemesThe OCaml module system can be intimidating, and it typically involves the use of many keywords—for example,
open
andinclude
, which allow importing definitions into a module. Since version OCaml4.08
, theopen
primitive has been generalized to allow the opening of arbitrary module expressions. In this article, we’ll explore how to use this generalization to reproduce a common practice in other languages, what I somewhat pompously call import strategies, to describe patterns likeimport {a, b as c} from K
, without relying on a (sub-)language dedicated specifically to importing. -
Guarded methods in OCamlGuarded methods allow attaching constraints to the receiver (
self
) only for certain methods, thus allowing these methods to be called only if the receiver satisfies these constraints (these guards). OCaml does not syntactically allow defining this kind of method directly. In this note, we will see how to encode them using a type equality witness.