Option in Java 8

Sam Pullara sam at sampullara.com
Thu Oct 11 08:38:04 PDT 2012

Hi Mario,

I'm with you on introducing an Option monad if we are going to have Optional. The current implementation is far from what I would want if we are going to add it to the collections library. 


On Oct 11, 2012, at 8:16 AM, Mario Fusco <mario.fusco at gmail.com> wrote:

>> There was a long thread on this recently on lambda-dev.  You should read
>> the archives.
>> The implementation is currently very much an approximation.  However, bear
>> in mind that the goal for Option in Java may not be to create an Option
>> monad.  So the experience of other languages may or may not be applicable.
> Thank you Brian,
> I gave a read to that thread, but I have to say it is still not completely
> clear to me what's the final goal of that Optional class indeed.
> The only other (ugly) thing I discovered is that it should allow something
> like a Some(null) that sounds really wrong to me or at least makes me think
> even more that I have not understood the purpose of that class.
> If you will give a quick read to the article I linked in my former email,
> it would be great if you will let me know what you think about it and
> mostly how my interpretation of the Option monad is far from what you have
> in mind.
> Thanks again,
> Mario

More information about the lambda-dev mailing list