Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are lots of places where it can help, but to give one example consider the Java 8 Optional type.

It’s great for avoiding nulls, but you get excessive nesting with many isPresent checks. Do notation can fix this.

The language even provides a bind function, but no reasonable way to use it!



Excessive nesting? Optional supports both .map and .flatMap.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: