In hg changeset 6331:af4b2dd992d6 (build 62), Optional.map was removed from the Lambda code. So they are moving in the opposite direction. Now there are three important missing features: map, flatMap, and iteration.
Regarding Dick Wall's comments on episode #397 - Option's main advantage is not avoiding NPE's, but factoring common null-related conditional logic out of all your code and into a standard library component. See JDK author Brian Goetz explain the rationale for adding Optional with a simple Java snippet here: http://mail.openjdk.java.net/pipermail/lambda-dev/2012-September/005952.html - Java's for loop is completely adequate for Option/Optional. Java doesn't need for-comprehensions or for-yield or pattern matching for a complete Optional. - Scala's API does use null rather than Option in a few places. Scala.xml for one. I vaguely remember seeing other places, but I can't recall exactly where right now. Even without a green field implementation like Haskell, having a good Optional type is still valuable even in a mixed null/Optional environment. On Tuesday, October 23, 2012 7:22:54 PM UTC-5, clay wrote: > > Has anyone seen java.util.Optional in the new Lambda builds? > > Why is there no flatMap? > > Why does it not support iteration (can't do a for loop over an Optional)? > > Why doesn't it have Some/None subclasses? > > Why does Scala and Functional Java get this right yet Guava and now the > core Java guys completely ruin it? > > Why doesn't Java 8 have persistent immutable collections? > > > Some of the JDK developers have real talent, but this is completely > amateur. > > I really hope they can fix this before it is set in stone. Tons of decent > functional programmers can write a complete Option implementation easily as > a fun exercise. It boggles my mind that they don't have the decent talent > working on something so important. > > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/FIwskPnhYj0J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
