2 ms·
I know the differences between untagged and tagged unions, I'm trying to provide a minimal example without distracting details but sure we can talk about tagged
by joshlemer 5y ago
I know the differences between untagged and tagged unions, I'm trying to provide a minimal example without distracting details but sure we can talk about tagged unions. Here is a list of tagged unions, so I once again point out that sum types are "supported" in JSON/ions just as much as any other data type:
[
{tag: "a", foo: 1},
{tag: "b", bar: "hi", baz: 2},
{tag: "a", foo: 3},
{tag: "a", foo: 4},
{tag: "a", foo: 5},
{tag: "b", bar: "yo", baz: 6}
]