|
|
|
|
|
by ronenlh
1775 days ago
|
|
The Sum is called Union in the TypeScript docs, as it narrows the valid values to the overlapping elements. In the switch statement it becomes a Sum value (as shown in the article). In ReScript (shown as well, which uses OCaml under the hood) the syntax is that of a Variant, in which each element is a different nominal type. |
|