Extending existing data structure in Scala.
- by Lukasz Lew
I have a normal tree defined in Scala.
sealed abstract class Tree
case class Node (...) extends Tree
case class Leaf (...) extends Tree
Now I want to add a member variable to all nodes and leaves in the tree.
Is it possible with extend keyword or do I have to modify the tree classes by adding [T]?