Or in Scala, technically not an ML, but is as close as you'll get in a nominally typed language.
enum RGB: case Red, Green, Blue def log(x: RGB) = x match case Red => print("red") case Green => print("green") // error, not exhaustive
Ton of powerful languages to choose from these days, good times...
Or in Scala, technically not an ML, but is as close as you'll get in a nominally typed language.
Obviously Scala can do a lot more, including GADTs, which Rust will never have until HKTs are supported.Ton of powerful languages to choose from these days, good times...