Why doesn't passing Nil to foldLeft work?
When I build a list using foldLeft I often get annoyed at having to explicitly type the injected parameter and wish I could just use `Nil' instead - here's a contrived example: scala> List(1,2,3).foldLeft(List[Int]())((x,y) => y :: x) res17: List[Int] = List(3, 2, 1) scala> List(1,2,3).foldLeft(Nil)((x, y) => y :: x) <console>:10: error: type mismatch; found : List[Int] required: scala.collection.immutable.Nil.type List(1,2,3).foldLeft(Nil)((x,y) => y :: x) This isn't so bad with a List[Int] but as soon as you start using lists of your own classes, which are almost certainly going to have