Higher-kinded bounded polymorphism in OCaml (2021)

The web content discusses higher-kinded polymorphism, the abstraction over a type constructor to be supplied with arguments. In OCaml, although not directly supported, higher-kinded polymorphism can be expressed in various ways, some less known than others. The content explores the reasons why OCaml does not support higher-kinded polymorphism directly and presents alternatives using modules (functors) as a workaround. Surprisingly, Yallop and White demonstrate in their FLOPS 2014 paper that higher-kinded polymorphism can be reduced to ordinary polymorphism through defunctionalization. Interestingly, in some cases, sidestepping higher-kinded polymorphism can be more appropriate for certain problems.

https://okmij.org/ftp/ML/higher-kind-poly.html

To top