わからん
[code lang=text] scala> List(1, 2, 3) map (_ + 1) res0: List[Int] = List(2, 3, 4)
scala> val words = List("the", "quick", "brown", "fox") words: List[String] = List(the, quick, brown, fox)
scala> words map (_.length) res1: List[Int] = List(3, 5, 5, 3)
scala> words map (_.toList.reverse.mkString) res2: List[String] = List(eht, kciuq, nworb, xof)
scala> words map (_.toList) res3: List[List[Char]] = List(List(t, h, e), List(q, u, i, c, k), List(b, r, o, w, n), List(f, o, x))
scala> words flatMap (_.toList) res4: List[Char] = List(t, h, e, q, u, i, c, k, b, r, o, w, n, f, o, x)
scala> List(List(1,3,4),List(3,4)).flatten.map(_ + 1) res5: List[Int] = List(2, 4, 5, 4, 5)
scala> List(List(1,3,4),List(3,4)).flatMap(e => | e.map(_ + 1) | ) res6: List[Int] = List(2, 4, 5, 4, 5) [/code]