On 15.8.12 5:31, Julian Reschke wrote:
> On 2012-08-14 15:47, Michael Dürig wrote:
>> ...
>> An even better way to handle this is to return an Option<T>. Guava has
>> something along these lines [1]. Unfortunately Guava's version of Option
>> is not a monad which makes it not as useful as it could be.
>> ...
>
> It looks cool first, but I'm totally unconvinced that replacing null
> checks by "isPresent()" checks really makes things better.
That's the particular problem with the Guava implementation which
doesn't provide map/flatMap methods. Having these you don't need
isPresent() but rather lift your operation into the monad.
Michael
>
> Best regards, Julian
|