FlatMapper

Tim Peierls tim at peierls.net
Thu Feb 21 09:39:27 PST 2013


On Thu, Feb 21, 2013 at 12:18 PM, Joe Bowbeer <joe.bowbeer at gmail.com> wrote:

> Is mapInto more easily confused with other names such as 'collect'?
>
No, I don't think so.

As Kevin pointed out, there's not enough new going on here to deserve a
fancy new (scary) name. We're taking a stream of T values and *map*ping
each one to zero or more U instances and putting them *into* a U consumer.
In the general case, it's not really flattening (or exploding), even though
what I would describe in those terms is a special case of this.

FlatMapper is a *synecdoche*, a more specific term standing in for a more
general concept, and if it makes Scala devotees happy, then I guess it does
no harm. But (and I know it must seem like I'm reversing myself, since I
suggested "flattenInto") I don't see a need to repeat the favor in the
method name.

--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130221/a2b9af6f/attachment-0001.html 


More information about the lambda-libs-spec-experts mailing list