Existe alguma diferença entre flatten e flatMap (identidade)?
scala> List(List(1), List(2), List(3), List(4))
res18: List[List[Int]] = List(List(1), List(2), List(3), List(4))
scala> res18.flatten
res19: List[Int] = List(1, 2, 3, 4)
scala> res18.flatMap(identity)
res20: List[Int] = List(1, 2, 3, 4)
Existe alguma diferença entre essas duas funções? Quando é apropriado usar um sobre o outro? Existem trocas?