2 ms·
Tagged unions, if I understand what they are, can be done in SQL: create table Foo( fooId primary key autoincrement, type integer /* tag/discr
by Mikhail_Edoshin 7y ago
Tagged unions, if I understand what they are, can be done in SQL:
create table Foo(
fooId primary key autoincrement,
type integer /* tag/discriminant */ );
create table FooA(fooId primary key,
/* data specific to FooA */ );
create table FooB(fooId primary key,
/* data specific to FooB */ );
They're not quite markup though. Markup has a string/stream with associated records. The number of these records, their kind, and their placement varies, so it can handle ordering issues or multiple similar names or missing name (e.g. missing middle name), or ignore parts of name quite naturally.
- naasking 7y agoYes, you can simulate them, but it's painful.
- no-s 7y agoIt's not a simulation, it's a data model for reducing the pain for what's really a hard problem - names we call people are not unique, they are colloquial identifiers (HHOS).
- naasking 7y agoJoined tables on the same primary key are a simulation of tagged unions. Proper tagged unions would solve more concisely and with more clarity.
- Quekid5 7y agoThat could be an implementation of tagged unions. Without language level support (pattern matching, exhaustiveness checking, etc.) you gain very little from this.