3 ms·
One technical reason that makes me prefer OCaml to Haskell is Haskell's weak module system. I think there should be a good way to parameterize one module over a
by more_original 11y ago
One technical reason that makes me prefer OCaml to Haskell is Haskell's weak module system. I think there should be a good way to parameterize one module over another module (interface) and to use different instantiations of the module in the same program.
I think people do such things using type classes and typing constraints. But I found this being awkward, because the compiler needs to be able to resolve the constraints automatically and there are issues with overlapping instances and the like.
To quote Bob Harper:
As a consequence, using type classes is, in Greg Morrisett’s term, like steering the Queen Mary: you have to get this hulking mass pointed in the right direction so that the inference mechanism resolves things the way you want it to. [https://existentialtype.wordpress.com/2011/04/16/modules-matter-most https://existentialtype.wordpress.com/2011/04/16/modules-mat...] (I think this applies most of all if one is using type classes to emulate a module system. For other purposes, type classes are quite nice.)
Maybe Backpack will solve these issues.
[http://plv.mpi-sws.org/backpack/ http://plv.mpi-sws.org/backpack/]