Hacker News new | ask | show | jobs
by avgcorrection 837 days ago
The author considered the Go pattern for “enums”. Found it lacking. Made their own code generator for their preferred pattern.

That’s two options. What are the others that are meaningfully different? You have to be able to deal with simple “sum types” in the sense of: this type could take on the value of one of these X predetermined constants. This requirement doesn’t disappear just because the language doesn’t directly support it.