Closed GoogleCodeExporter closed 9 years ago
There's a two-line implementation in terms of methods we already provide:
public static <A, B> Iterable<B> flatTransform(Iterable<A> collection,
Function<A, Iterable<B>> functor) {
Iterable<Iterable<B>> iterables = Iterables.transform(collection, functor);
return Iterables.concat(iterables);
}
I don't see any pressing reason to add flatMap to the library.
Original comment by jared.l....@gmail.com
on 1 Nov 2007 at 11:59
Fair enough that it can be done in two lines, but why not have it there for
others to
make use of?
Original comment by ryan.daum
on 2 Nov 2007 at 12:19
Because that way lies madness.
We only want to provide two-liner convenience methods for the things users do
very,
very, very, very often. See also
http://code.google.com/p/google-collections/issues/detail?id=18
Original comment by kevin...@gmail.com
on 2 Nov 2007 at 12:26
Original issue reported on code.google.com by
ryan.daum
on 1 Nov 2007 at 11:36