lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 2 years agoAre there other languages that rust where enums can store data?message-squaremessage-square6fedilinkarrow-up18arrow-down11
arrow-up17arrow-down1message-squareAre there other languages that rust where enums can store data?lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 2 years agomessage-square6fedilink
minus-squarenorthbound_goat@szmer.infolinkfedilinkarrow-up8·2 years agoMost functional languages, like Haskell, ML family (SML, OCaml, F#). They’re usually not using an enum keyword though.
minus-squareEphera@lemmy.mllinkfedilinkarrow-up7·2 years agoYeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type
Most functional languages, like Haskell, ML family (SML, OCaml, F#). They’re usually not using an
enum
keyword though.Yeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type