First Draft: opUnwrapIfTrue

Paul Backus snarwin at gmail.com
Wed Jul 15 18:41:20 UTC 2026


On Tuesday, 14 July 2026 at 03:08:47 UTC, Mindy (0xEAB) wrote:
> On Thursday, 26 February 2026 at 16:01:22 UTC, Paul Backus 
> wrote:
>> This seems like an entirely self-inflicted problem. You've 
>> designed an API that's a pain in the butt to use, and now you 
>> want to add a language feature to compensate for your bad 
>> design.
>
> Yeah, how about we add proper sumtypes to the language instead 
> of duct-taping on features to make up for the lack thereof?

The specific feature whose absence this proposal is duct-taping 
over is pattern matching. It's basically a special case of Rust's 
"if let":

https://doc.rust-lang.org/book/ch06-03-if-let.html


More information about the dip.development mailing list