Hacker News new | past | comments | ask | show | jobs | submit login

> it's one of those features that outside of Rust you only really find in ML-family languages

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
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...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: