foreach, for-loop, . , , .
type E[V] = {def foreach[U](f: (V) => U)}
def test2[Q[R] <: E[R],R[S] <: E[S],S[T] <: E[T],T](x: Q[R[S[T]]]) {
for (a <- x; b <- a; c <- b) println(c)
println("----------")
}
:
scala> test2(List(List(List(8))))
8
scala> test2(Some(List(Some(8))))
8
for-loop , E, flatmap map-methods foreach.