First Draft: Nominal Sum Types via `enum union` and `switch` Expressions

Paul Backus snarwin at gmail.com
Sun Sep 20 18:03:22 UTC 2026


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.


More information about the dip.development mailing list