MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/fxvlow/why_im_leaving_elm/fn2wh6s/
r/programming • u/Elession • Apr 09 '20
268 comments sorted by
View all comments
Show parent comment
3
Can you point me to a language which has enumerable enums? I want to learn how they are supposed to work.
2 u/kankyo Apr 11 '20 Python although very recently.OCaml using %deriving.Pretty sure haskell has a similar thing to ocaml deriving but don't know what it's called.All languages that have macros can have them trivially so all lisps, nim, etc. 3 u/THeShinyHObbiest Apr 12 '20 You can derive the enum typeclass 1 u/kankyo Apr 12 '20 Thanks. 2 u/JB-from-ATL Apr 13 '20 Pretty sure Java exposes a values method that returns an array of all the possibilities. 1 u/L8_4_Dinner Apr 11 '20 Sure. Here's an example of the capabilities of each value in an enumeration (Enum) and here's what each enumeration class is augmented with via mixin (Enumeration). For a reasonable example of an enumeration, see Boolean.
2
Python although very recently.
OCaml using %deriving.
Pretty sure haskell has a similar thing to ocaml deriving but don't know what it's called.
All languages that have macros can have them trivially so all lisps, nim, etc.
3 u/THeShinyHObbiest Apr 12 '20 You can derive the enum typeclass 1 u/kankyo Apr 12 '20 Thanks.
You can derive the enum typeclass
1 u/kankyo Apr 12 '20 Thanks.
1
Thanks.
Pretty sure Java exposes a values method that returns an array of all the possibilities.
Sure. Here's an example of the capabilities of each value in an enumeration (Enum) and here's what each enumeration class is augmented with via mixin (Enumeration). For a reasonable example of an enumeration, see Boolean.
View all comments
Show parent comment
3
u/_tskj_ Apr 11 '20
Can you point me to a language which has enumerable enums? I want to learn how they are supposed to work.