7 ms·
There are libraries that simulate a lot of these things (e.g. https://github.com/G-Research/TypeEquality https://github.com/G-Research/TypeEquality for GADTs).
by Nelkins 10mo ago
There are libraries that simulate a lot of these things (e.g. https://github.com/G-Research/TypeEquality https://github.com/G-Research/TypeEquality for GADTs). You're absolutely right that it's not as first class as in OCaml, but the tools are there if you want them.
- debugnik 10mo agoI've written type-equality witnesses in F#, they can kinda recover type equalities (with cast methods) but not refute them, so you still need to raise exceptions for those cases.