Bikeshed opportunity: compose vs composeWith (original) (raw)
Brian Goetz brian.goetz at oracle.com
Mon Nov 26 10:01:12 PST 2012
- Previous message: No-reuse and stream destructuring as (first, rest) pair
- Next message: Bikeshed opportunity: compose vs composeWith
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
We've got two changesets in flight that introduce a compose method:
interface Function<T,R> { default Function<T,U> compose(Function<R,U> other) { ... } }
interface Comparator { // create a dictionary-order comparator default Comparator compose(Comparator other) { ... } }
We received some feedback that users found "compose()" at the use-site slightly ambiguous. I'm starting to lean towards "composeWith(fn)", despite it being slightly more wordy. Preferences?
Comparator byFirst = Comparators.comparing(Person::getFirstName); Comparator byLast = Comparators.comparing(Person::getLastName); Comparator byFirstLast = byLast.composeWith(byFirst);
- Previous message: No-reuse and stream destructuring as (first, rest) pair
- Next message: Bikeshed opportunity: compose vs composeWith
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list