GADTs allow one to statically enforce stronger program invariants than are otherwise possible in a Hindley-Milner style type system. This post retells the story of how to “roll your own” GADTs using an explicit type of equality constraints. More interestingly, we discuss a particularly versatile definition of type equality in Haskell that can now be transcribed into OCaml due to the recent additio
![More expressive GADT encodings via first class modules - Jane Street Tech Blogs](https://cdn-ak-scissors.b.st-hatena.com/image/square/5e850c9a7f9bea9d3297c13d4ed631365ac53ee6/height=288;version=1;width=512/https%3A%2F%2Fblog.janestreet.com%2Fstatic%2Fimg%2Fheader.png)