Hacker News new | ask | show | jobs
by kodablah 3351 days ago
"How we declare the destructuring pattern in the AddNode class, or declare AddNode so that it implicitly acquires one, will be covered in a separate document."

Please use a Scala unapply() and not just constructor parameters. The former gives much more latitude to build patterns.

I have a ton more to say about all of this having written in Scala and Kotlin extensively. I'll just say that it is useful they are already thinking about new variable assignment to parts of matches and NOT concerning themselves w/ "smart casts".