Option in Java 8

Mario Fusco mario.fusco at gmail.com
Thu Oct 11 07:27:15 PDT 2012

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 mailing list