On Tuesday, 29 November 2022 at 06:26:20 UTC, Walter Bright wrote:
>Go ahead, Make My Day! Destroy!
https://github.com/WalterBright/DIPs/blob/sumtypes/DIPs/1NNN-(wgb).md
DIP is missing
- Canonicalization of
sumtype
members. Specifically:- Independence of order of members
sumtype S {T,U}
should be the same assumtype S {U,T}
. - Deduplication of members either as a compiler error or as a silent automatic removal of duplicate types. Moreover, what about
sumtype S {a T, b U}
vssumtype S {a U, b T}
and
sumtype S {a T, b U}
vssumtype S {b T, a U}
?
- Independence of order of members
For reference see how mir.algebraic.Variant
canonicalizes template type parameters using the trait TypeSet
at https://github.com/libmir/mir-core/blob/master/source/mir/algebraic.d#L447.