Re:OCaml Modules: Think Immutable Singletons
by DonPellegrino on Sunday May 24, 2015 @04:16PM
(#9597418)
You sort of can with functors or GADTs.
[ Parent
| on HN ]
Like you say, sort of. This would imply that you wrap all the basic types in a sum type. It's quite heavy. Using the PPX mechanism the compiler can also be extended to generate this code automatically but again, this isn't very natural at the moment.