Hey all,
First of all, just let me say, I am not wishing to bring up a
discussion about the upcoming Optional's API, or to suggest changes. I
have read the discussion here[1] and don't want to cover old ground.
What I am asking for, is if it would be possible to summarise and
publicise the arguments put forward on Google's internal Java mailing
list which lead to the planned API for Optional. I obviously don't
want the entire source posted online, just a couple of general bullet
points would do.
The reason I ask is that our team is attempting to use an Optional-
like construct (adopting Nat Pryce's Maybe[2]) and are finding
ourselves frequently banging into problems. Things like not having a
standard Function0 to map the 'orElse' value to, not having a side-
effect only function type to lazily execute against None. There are
ways to get around these examples, but we've not found any of them to
be particularly satisfying, and are wondering if it's the language,
the implementation, or just us :-)
It would be really useful if we could find out the reasons behind
Optional's API, to see if they align with the kind of problems that a
more functional, Scala Option-like construct leads to in Java.
Thanks for a great library,
Graham
[1]
http://groups.google.com/group/guava-discuss/browse_thread/thread/2558185aae955387
[2]
https://github.com/npryce/maybe-java