2 ms·
Basically every language has ad-hoc products in the form of tuples. They aren’t structurally typed in ocaml, which is the interesting part. Typescript has labe
by wyager 9y ago
Basically every language has ad-hoc products in the form of tuples. They aren’t structurally typed in ocaml, which is the interesting part. Typescript has labeled products that have similar subtyping rules to ocaml’s anonymous sum subtyping rules. Eg {x:a, y:b} < {x:a}.
- ernst_klim 9y agoObjects in OCaml are labeled products. < x:a; y:b > <: <x:a>
- wyager 9y agoAh, I did not know that. I’ve only used the {x : a} record syntax in ocaml.