xvw.lol

Index

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.

Essays and ramblings

Here is a list of articles/translations on various subjects, such as OCaml.


  • The Hell of Tetra Master

    Tetra Master is the optional card game in Final Fantasy IX. At first glance, it seems similar to Triple Triad — the card game from Final Fantasy VIII. And while you can develop a general intuition for how to win, especially if you have strong cards, after playing over a hundred matches, I had to admit something: just playing the game and reading all the in-game tutorials wasn’t enough to truly understand the rules. Eventually, I gave in and started looking things up to figure out what I was missing. The complete absence of any actual rules — whether in the game or the manual — left me utterly frustrated, which is what led me to write this article, illustrated in OCaml.

    • final-fantasy
    • game-design
    • videogame
    • ocaml

  • OCaml, modules, and import schemes

    The OCaml module system can be intimidating, and it typically involves the use of many keywords—for example, open and include, which allow importing definitions into a module. Since version OCaml 4.08, the open 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 like import {a, b as c} from K, without relying on a (sub-)language dedicated specifically to importing.

    • programming
    • ocaml
    • modules

  • Guarded methods in OCaml

    Guarded 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.

    • programming
    • type
    • oop
    • ocaml
    • gadt