What is the "right" way to add constraints on a type, to handle recursive structures with variants and to combine fragments of types?

You’re asking too many questions It is hard to address them all, so this may scare people away, my suggestion would be to split your question into several small and well-scoped questions. Anyway, you are indeed using OCaml a little bit incorrectly because you’re confusing data and types. Records,…