A design that subsumes the various syntactic forms of
ifstatements/expressionsswitchon valuesmatchon patterns and pattern guardsif-letconstructs
and scales from simple one-liners to complex pattern matches.
A design that subsumes the various syntactic forms of
if statements/expressionsswitch on valuesmatch on patterns and pattern guardsif-let constructsand scales from simple one-liners to complex pattern matches.
Sure, there are some worse/more limited predecessors – my design was partially motivated by a desire to improve upon these.
For instance, that ML-derivative you are using for your examples
if then elsein the language, thus making it not unifiedmatchis very limited in which coding patterns it can expressAlso, none of the examples are “more clear” or “have less magic”:
Maybe they are more “familiar” to you personally, but that’s about it.
Too me they just look clunky, full of accidental complexity and trying to work around a poor/limited language design.