News for hackers. Stuff that matters.
Re:Optional If Expressions by yxhuvud on Saturday April 15, 2023 @01:21AM (#35577828)
For what it's worth, this is essentially what Crystal does, though by introducing a union type instead of an optional.
Re:Optional If Expressions by valenterry on Saturday April 15, 2023 @02:11AM (#35578067)
This is the way to go.
Re:Optional If Expressions by duped on Saturday April 15, 2023 @12:29PM (#35582102)
The only problem is that it can't distinguish between nested if/else blocks at the type level, but it's probably fine