Is it valid to reduce on an empty set of sets?
Shouldn't this work? > val setOfSets = Set[Set[String]]() setOfSets: scala.collection.immutable.Set[Set[String]] = Set() > setOfSets reduce (_ union _) java.lang.UnsupportedOperationException: empty.reduceLeft at scala.collection.TraversableOnce$class.reduceLeft(TraversableOnce.scala:152) [...] Reduce (left and right) cannot be applied on an empty collection. Conceptually: myCollection.reduce(f) is similar to: myCollection.tail.fold( myCollection.head )( f ) Thus the collection must have at least one element. This should do what you want: setOfSets.foldLeft(Set[String]())(_ union _) Although I