First Draft: Nominal Sum Types via `enum union` and `switch` Expressions
Meta
jared771 at gmail.com
Sun Sep 20 20:46:14 UTC 2026
On Sunday, 20 September 2026 at 18:03:22 UTC, Paul Backus wrote:
> On Sunday, 20 September 2026 at 17:37:36 UTC, Meta wrote:
>>
>> My point was that `case 42 =>` and `case int n if (n == 42)
>> =>` are equivalent, so his use case is covered. I decided
>> against adding full pattern matching in lieu of saving it for
>> a future DIP.
>
> IMO trying to do a partial implementation of pattern matching
> like this is a mistake. Better to either do it fully, and smoke
> out any potential issues with the design, or leave it entirely
> for later.
>
> Even if you want to split sum types and pattern matching into
> two DIPs, I think it would be best to finish writing both of
> them before submitting either one.
I already have a fleshed out version of pattern matching that
builds on this DIP. And if that future DIP is not accepted, then
what's here is already very useful in terms of functionality.
More information about the dip.development
mailing list