this post was submitted on 01 Jun 2022
8 points (100.0% liked)

Rust Programming

8011 readers
1 users here now

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] northbound_goat@szmer.info 8 points 2 years ago (1 children)

Most functional languages, like Haskell, ML family (SML, OCaml, F#). They're usually not using an enum keyword though.

[โ€“] Ephera@lemmy.ml 7 points 2 years ago

Yeah, in language theory, this kind of thing is called an "Algebraic Data Type": https://en.wikipedia.org/wiki/Algebraic_data_type