4 ms·
Having two datatypes with the same field name in scope doesn't work well with type inference. OCaml permits it, but it requires type annotations, and in practic
by djur 11y ago
Having two datatypes with the same field name in scope doesn't work well with type inference. OCaml permits it, but it requires type annotations, and in practice it seems like developers solve the problem the same way Haskell does -- separate modules.
That said, working with modules is a lot nicer in OCaml than in Haskell, so it's a less painful solution.