lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 4 years agoAre there other languages that rust where enums can store data?message-squaremessage-square6linkfedilinkarrow-up18arrow-down11
arrow-up17arrow-down1message-squareAre there other languages that rust where enums can store data?lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 4 years agomessage-square6linkfedilink
minus-squarenorthbound_goat@szmer.infolinkfedilinkarrow-up8·4 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·4 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
enumkeyword though.Yeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type