Scala, Kotlin, Haxe, Swift, and several others. The search term you want is "Algebraic Data Types"
Erlang has the superpowered version of this - binary pattern matching, that lets you pattern match on a bitstream directly.
Erlang has the superpowered version of this - binary pattern matching, that lets you pattern match on a bitstream directly.
Erlang has a super-powered version of the pattern matching bit, but not of what GP actually likes about it:
> you have to handle every case whenever you're matching on it
because Erlang is dynamically typed. So partial patterns are acceptable, and not entirely uncommon.
Also faillible patterns outside of conditional contexts. It acts as an assertion which is nice, but the assertion is implicit which is less nice.