And do they support this kind of smart warnings on unmatched possibilities?
Statically typed languages like Haskell and Rust require the programmer to list all possible cases when matching on a value.
> Statically typed languages like Haskell and Rust require
> the programmer to list all possible cases when matching
> on a value.
This isn't a consequence of static vs. dynamic, it's just a question of philosophy. In fact, Rust didn't use to require you exhaustively list out all cases, though it does today in order to help catch errors at compile-time rather than at runtime.I should also mention that if yo don't want to list out all variants, that's easily done by using the _ pattern (the "ignore this" pattern):
match some_direction {
East => print("You're going east!"),
_ => print("You're going in some direction that isn't east!")
}