this post was submitted on 18 Aug 2024
8 points (100.0% liked)

OCaml

63 readers
1 users here now

A community for the OCaml programming language https://ocaml.org

Looking for mods, if you want to mod the community feel free to dm Ategon

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 10 months ago
MODERATORS
 

There is more to Hindley-Milner type inference than the Algorithm W. In 1988, Didier Rémy was looking to speed up the type inference in Caml and discovered an elegant method of type generalization. Not only it is fast, avoiding scanning the type environment. It smoothly extends to catching of locally-declared types about to escape, to type-checking of universals and existentials, and even to MLF.

Alas, both the algorithm and its implementation in the OCaml type checker are little known and little documented. This page is to explain and popularize Rémy's algorithm, and to decipher a part of the OCaml type checker. The page also aims to preserve the history of Rémy's algorithm.

Read How OCaml type checker works

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here