DIP 1017--Add Bottom Type--Final Review

Tobias Müller troplin at bluewin.ch
Tue Jan 22 06:47:50 UTC 2019


H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> I don't argue that it's not a unit type.  But that's not the same thing
> as saying it's *the* unit type.  There may be multiple, distinct unit
> types, because D types are not structural types in the type theoretic
> sense;

Since a unit type consists of a single value, there exist as much unit
types as there exist values (at least in theory). The type that only has
the value '123' is a unit type as well as the type with the single value
'true' or an empty struct or tuple.

Which one serves as 'canonical' unit type is merely convention.

OTOH there can only be a single top type and a single bottom type by
definition.

---
Tobi


More information about the Digitalmars-d mailing list