I\'ve been thinking for a while how I would go about implementing a doubly-linked tree or list in Scala just using immutable case classes. For most \"update\" operations, I\
class A(val b: B) abstract class B { val a: A } new B { val a = new A(this) }