sumtypes for D

max haughton maxhaton at gmail.com
Tue Nov 29 00:49:51 UTC 2022


On Monday, 28 November 2022 at 21:52:20 UTC, Per Nordlöw wrote:
> On Monday, 28 November 2022 at 21:44:01 UTC, Per Nordlöw wrote:
>> Sum-types is the one feature I miss the most in D.
>
> Or rather the builtin feature I missed the most having 
> standardized with a template-free `match()` enabling fine-tuned 
> diagnostics.

Yes. You can do match as a template, fairly well even, but when 
it goes even slightly wrong it goes kaboom.

The current C++ proposal defines semantics for deferring to 
existing library code, even, so the semantics could still be 
preserved but under error messages we can be proud of.


More information about the Digitalmars-d mailing list