Hacker News new | ask | show | jobs
by diarrhea 941 days ago
Pattern matching can be done over structs as well, in Rust.
1 comments

Not nearly as expressively though. You can destructure a struct, but you can't express alternatives on anything but an enum. Languages like F#, Scala, Haskell support more ways of creating ADTs than the kind of enums that Rust has.