Skip to content

Instantly share code, notes, and snippets.

View avibryant's full-sized avatar

Avi Bryant avibryant

  • Galiano Island, BC
View GitHub Profile
@ryanlecompte
ryanlecompte / gist:7287415
Last active December 27, 2015 07:18
Immutable PrefixMap
import scala.collection.generic.CanBuildFrom
import scala.collection.immutable.MapLike
import scala.collection.mutable
/**
* Immutable version of the PrefixMap demonstrated in the Scala collections
* guide here: http://www.scala-lang.org/docu/files/collections-api/collections-impl_6.html
*
* This version also has a smarter remove method (doesn't leave behind dead nodes with empty values)
*/