That's a heck of a teaser! But can you elaborate some?
-
-
Yeah, I thought it was pretty much just sugar,
@oxnrtr? Are you thinking of the "inferred" extends clauses?3 replies 0 retweets 0 likes -
Replying to @DavidGregory084 @nuttycom and
1. enum supports only a very limited subset of ADTs 2. the migration between existing ADTs and enums cannot be done without breakage 3. you save exactly zero key presses at the use-site 4. people are going to hate Option as an enum, because that means it can never be a value type
1 reply 0 retweets 1 like -
-
-
This Tweet is unavailable.
-
Yeah, if you want more than one layer of nesting, use more than one ADT. This Nameable/Pet example is something I'd be horrified to find in a production Scala codebase.
4 replies 0 retweets 0 likes -
Could you explain why? With nesting you can use sealed trait at each level to ensure exhaustivity. I don't see it often but I can see the use of it.
1 reply 0 retweets 0 likes -
Replying to @DavidGregory084 @fommil and
I don't trust the exhaustivity checking of the pattern matcher that much. What does such a pattern match even look like? Do you do `case Unknown => ...; case p : Pet => match p { case Dog(..) => ... , ... }` or something? How is that better than `case Pet(Dog(...)) => ...`?
2 replies 0 retweets 0 likes -
This Tweet is unavailable.
This makes sense, though, because the set of direct subtypes still partitions the set of all instances.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.