Custom Ordering Scala TreeMap
12 July 2012 1 comment
Reading time:
3 minutes
Word count:
514
How do you get custom ordering in a Scala TreeMap? Well this puzzled me for a while. The answer lies in the world of implicits and receiver type converters. In a nut shell, a scala.collection.immutable.TreeMap is a SortedMap. If you look at the documentation for TreeMap, you will see it takes an Ordering[T] as an […]