Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default option for pattern match #34

Open
ethanabrooks opened this issue Mar 28, 2020 · 0 comments
Open

default option for pattern match #34

ethanabrooks opened this issue Mar 28, 2020 · 0 comments

Comments

@ethanabrooks
Copy link

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...
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant