Purely Functional data structures in Scala