Made a relatively short post about modeling open and closed universes of choices (enums are not always appropriate!):
Conversation
Replying to
Awesome post!
Regarding footnote 4, Scala has kind of gone the other way: it has always used sealed traits for defining tagged unions with exhaustive matching, but it now provides an `enum` syntax as sugar for this pattern: docs.scala-lang.org/scala3/referen
Interestingly people seem to have the impression that Scala's tagged unions are a 'hack'… hopefully the enum syntax might help people be less scared of them, even if it really is the same thing under the hood! 😅
1
1
Hah! Is there an equivalent to non-exhaustive enums, where the API is flexible enough to add new variants without causing a breaking change?
1
Show replies

