Hacker News new | ask | show | jobs
by zeugmasyllepsis 2708 days ago
I'm certainly not well versed in OCaml, but my understanding is that it is also structurally typed. This particular example would also be permitted in OCaml, correct?
1 comments

No, records are nominally typed in OCaml, thus the two types `A` and `B` would be deemed incompatible.
But objects in OCaml are structurally typed (well, row typed).