Consumers and Suppliers
Bruno P. Kinoshita
kinow at apache.org
Sat Apr 6 18:57:28 PDT 2013
I remember talking with someone on reddit [1] about class names in Java 8, Guava, Functional Java and Apache Functor.
Parts of this feedback were already merged into Apache Functor, and we are now discussing how to fix other issues before the first release.
Functional Java uses Effect too [2], but in Functor we call it Procedure [3]. The method names are still different (run, accept, e, etc), but we may use the same method name as Java 8 or some other already released library in Apache Functor (to help developers coming from other API's).
What I find confusing about Consumer is that the Java functional libraries that I used before (functional java and google guava) use different names. But nothing that writing a few classes wouldn't help :o)
[1] http://www.reddit.com/r/java/comments/158q1u/using_apache_commons_functor_functional/
[2] https://github.com/functionaljava/functionaljava/blob/master/core/src/main/java/fj/Effect.java
[3] http://commons.apache.org/proper/commons-functor/apidocs/org/apache/commons/functor/Procedure.html
Bruno P. Kinoshita
http://kinoshita.eti.br
http://tupilabs.com
>________________________________
> From: Jed Wesley-Smith <jed at wesleysmith.io>
>To: Brian Goetz <brian.goetz at oracle.com>
>Cc: lambda-libs-spec-observers at openjdk.java.net; "lambda-dev at openjdk.java.net" <lambda-dev at openjdk.java.net>
>Sent: Saturday, April 6, 2013 10:25 PM
>Subject: Re: Consumers and Suppliers
>
>We call it Effect, because the only possible thing a method that
>returns void can do, is side-effects.
>
>https://bitbucket.org/atlassian/fugue/src/master/src/main/java/com/atlassian/fugue/Effect.java
>
>On 6 April 2013 04:36, Brian Goetz <brian.goetz at oracle.com> wrote:
>>> About the choice of name of "Consumer", I seriously hate it. It has a
>>> connotation that the ownership of the object is transferred, and object
>>> might be dissolved. In many of my use cases, "consumer" simply sounds
>>> grotesque and totally misleading. I wish the choice was Procedure instead.
>>> (I'm just venting, not asking for change.)
>>
>> Yes, finding names was very hard. Suffice it to say that there was no
>> name considered that *someone* didn't hate.
>>
>
>
>
>
More information about the lambda-dev
mailing list