Created
May 15, 2013 22:51
-
-
Save dacc/5588059 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> case class Foo(bars: Seq[Int]) | |
defined class Foo | |
scala> val foos = Seq( | |
| Foo(bars=Seq(1, 2, 3)), | |
| Foo(bars=Seq(4, 5, 6)) | |
| ) | |
foos: Seq[Foo] = List(Foo(List(1, 2, 3)), Foo(List(4, 5, 6))) | |
scala> foos.map(_.bars).flatten | |
res1: Seq[Int] = List(1, 2, 3, 4, 5, 6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment