|
|
|
|
|
by ralfj
1415 days ago
|
|
If Rust leads to more languages for more domains adopting Rust-style enums and pattern matching (algebraic data types / sum types -- this idea predates Rust by decades, so "modern" is an interesting term to use), I'd call that a big win for everyone. :) It's pretty tricky to do that in an untyped language. But TypeScript could have this, or maybe even already does? |
|
AFAIK TypeScript doesn't have ML-style pattern matching, but its type system is fairly expressive and you can do something "like" it https://dev.to/gvergnaud/bringing-pattern-matching-to-typesc...