Option in Java 8
misterm at gmail.com
Thu Oct 11 08:04:30 PDT 2012
BTW, any reason for it not being final?
On Thu, Oct 11, 2012 at 11:54 AM, Brian Goetz <brian.goetz at oracle.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.
> On Oct 11, 2012, at 3:27 PM, Mario Fusco wrote:
>> Hi all,
>> a couple of days ago I posted an article about how we could possibly
>> implement and use an Option monad in Java 8:
>> Now, a friend of mine just found that you are already implementing
>> something very similar:
>> I'd be very happy to have an Option (and possibly a Validation) monad in
>> Java 8. However, I don't know if that is the last implementation available,
>> but if so I have to admit that I am a bit disappointed about it. The first
>> improvements that comes to me in mind are:
>> 1. it should be an abstract class with 2 concrete implementations
>> 2. a flatMap method would be very useful
>> 3. it could implement the Iterable interface
>> What do you think about that?
More information about the lambda-dev