Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant