[Solved] flatten and flatMap in scala

Take a look at the full signature for flatten: def flatten[B](implicit asTraversable: (A) ⇒ GenTraversableOnce[B]): List[B] As you can see, flatten takes an implicit parameter. That parameter provides the rules for how to flatten the given collection types. If the compiler can’t find an implicit in scope then it can be provided explicitly. flatten can … Read more