Option in Java 8
brian.goetz at oracle.com
Thu Oct 11 07:54:13 PDT 2012
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