First, let just thank you so much for your work on this. Python is inescapable for many people working in data/machine learning, but any modern language should have sum types and pattern matching! Somehow Javascript sorted it out with Typescript. This really should be a standard feature with support for standard | sum type syntax 😖
Ok. Rant complete.
Are you considering adding a default option for pattern matching? I know that there are arguments against it, but otherwise you end up writing things like:
e.match(
VAR1=lambda x: f(x)
VAR2=lambda _: g()
VAR3=lambda _: g()
VAR4=lambda _: g()
# you get the idea...
)
First, let just thank you so much for your work on this. Python is inescapable for many people working in data/machine learning, but any modern language should have sum types and pattern matching! Somehow Javascript sorted it out with Typescript. This really should be a standard feature with support for standard
|
sum type syntax 😖Ok. Rant complete.
Are you considering adding a default option for pattern matching? I know that there are arguments against it, but otherwise you end up writing things like: