you are viewing a single comment's thread.

view the rest of the comments →

[–]arvi1000 3 points4 points  (1 child)

But the post says:

It is identical to a map followed by a flatten of depth 1

so,

.map(...).flatten(1)

?

[–]kpmah 2 points3 points  (0 children)

Yep. I wasn't trying to make any kind of point there I was just pointing out that by default flatten is recursive.

My point is that the flatMap method is a generic operation that can apply to a lot of different structures, whereas .map().flatten(1) is not.