FlatMapper

Remi Forax forax at univ-mlv.fr
Sun Feb 17 03:17:06 PST 2013


On 02/17/2013 06:31 AM, Joe Bowbeer wrote:
> > mapAndFlattenInto ?
>
> OK

I really like explode just because we will see comments on mailing list 
saying that someone have a problem when they try to explode :)

mapAndFlattenInto is a little to verbose for me, mapAndFlat ?

Rémi

>
>
> On Fri, Feb 15, 2013 at 10:48 AM, Brian Goetz <brian.goetz at oracle.com 
> <mailto:brian.goetz at oracle.com>> wrote:
>
>     So it seems the choice is:
>
>      - Keep this tied to flatMap and keep it in JUS.  Advantage: makes
>     the complicated flatMap(FlatMapper) operation easier to understand.
>
>      - Abstract this into a general "map to multiple values and dump
>     results into a Consumer" type, move to JUF, ane rename to
>     something like "MultiFunction".  Advantage: more future
>     flexibility; Disadvantage: mostly guessing about what we might
>     want in the future.
>
>     I lean towards the first.
>
>     In which case the remaining decision is: what to name the method.
>
>     Maybe:
>
>       mapAndFlattenInto
>
>     ?
>
>
>     On 2/14/2013 4:33 PM, Joe Bowbeer wrote:
>
>         I'm not opposed to explode, but I think it would be better to
>         find a
>         verb that is related to flattening.  Extrude is better in that
>         regard
>         than explode.
>
>         extrudeInto
>         mapAndExtrude
>
>         On the downside, 'explode' has more hacker cred than 'extrude'.
>
>           --Joe
>
>
>         On Thu, Feb 14, 2013 at 12:56 PM, Brian Goetz
>         <brian.goetz at oracle.com <mailto:brian.goetz at oracle.com>
>         <mailto:brian.goetz at oracle.com
>         <mailto:brian.goetz at oracle.com>>> wrote:
>
>             OK, so far we have:
>               - Joe asks for a better method name -- no suggestions
>         other than
>             mapAndFlatten
>               - No consensus on whether this goes into JUS or JUF.
>
>
>
>
>             On 2/12/2013 1:41 PM, Brian Goetz wrote:
>
>                 Here's where things have currently landed with
>         FlatMapper --
>                 this is a
>                 type in java.util.stream, with nested specializations.
>
>                 Full bikeshed season is now open.  Are we OK with the name
>                 explodeInto()?  Is this general enough to join the
>         ranks of
>                 Function and
>                 Supplier as top-level types in java.util.function?
>
>                 @FunctionalInterface
>                 public interface FlatMapper<T, U> {
>                       void explodeInto(T element, Consumer<U> sink);
>
>                       @FunctionalInterface
>                       interface ToInt<T> {
>                           void explodeInto(T element, IntConsumer sink);
>                       }
>
>                       @FunctionalInterface
>                       interface ToLong<T> {
>                           void explodeInto(T element, LongConsumer sink);
>                       }
>
>                       @FunctionalInterface
>                       interface ToDouble<T> {
>                           void explodeInto(T element, DoubleConsumer
>         sink);
>                       }
>
>                       @FunctionalInterface
>                       interface OfIntToInt {
>                           void explodeInto(int element, IntConsumer sink);
>                       }
>
>                       @FunctionalInterface
>                       interface OfLongToLong {
>                           void explodeInto(long element, LongConsumer
>         sink);
>                       }
>
>                       @FunctionalInterface
>                       interface OfDoubleToDouble {
>                           void explodeInto(double element,
>         DoubleConsumer sink);
>                       }
>                 }
>
>
>



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