Skip to content

Instantly share code, notes, and snippets.

View AlexanderWingard's full-sized avatar

Alexander Wingård AlexanderWingard

View GitHub Profile
import scala.collection.Map
class PitTree[+T](val children : Map[String, PitTree[T]], val value : Option[T]) extends Map[String, T] {
def this() = this(Map(), None)
def this(value : T) = this(Map(), Some(value))
def update[T1 >: T](path : String, upVal : T1) : PitTree[T1] = this.+(path -> upVal)
override def empty = new PitTree[T]