It is unlikely that we will drop Option in favour of Optional in Functional Java, as that would be a step backwards for the library if Optional does not gain flatMap etc. There will almost certainly be a compatibility layer.
As an aside, it's amazing how small an amount of code we're really talking about. I just implemented Option and List including map and flatMap in JavaScript for fun on the way home from work (and missed my stop!). On Thu, Nov 1, 2012 at 9:39 PM, clay <[email protected]> wrote: > OK, I wrote Optionals for JDK8 which adds static functions map, flatMap, and > toIterable > > http://pastebin.com/HZ1suSRt > (I would probably adjust the generics type boundaries if this was a serious > effort) > > So that these work: > > map(optObj, (o) -> ...); > flatMap(optObj, (o) -> ...); > for (T t : toIterable(optObj)) { ... } > > For at least the first two, C#-style extension methods would offer more > natural syntax, but I don't think that is a big deal: > > optObj.map((o) -> ...); > optObj.flatMap((o) -> ...); > > The major downside is that this will be another third-party add-on library > and not built-in to the core standard library. > > Will third party libraries -- mainly Functional Java but also others like > Atlassian Fugue -- standardize on the JDK8 option and use static methods for > the omitted features or will they continue to use completely separate Option > class implementations? > > -- > 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/-/9-5GnOv9VGUJ. > > 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. -- You received this message because you are subscribed to the Google Groups "Java Posse" group. 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.
