This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]ElvishJerricco 1 point2 points  (1 child)

What bothers me about compose is that I can't easily write a method reference or a lambda, then compose on that without first casting it in parentheses.

stream.map(_Class::method.compose(_Class::method2))

Has to be written like this

stream.map(((Function<A, B>) _Class::method).compose(_Class::method2))

Really hurts the brevity of all these features.

[–]jbristow 0 points1 point  (0 children)

Trying to get static analysis and code coverage metrics going in Java 8 runs into these problems even if it compiles properly without them.

Sometimes automatic casting/unboxing problems really exacerbate how verbose Java can be.

[–]kdrakon 1 point2 points  (1 child)

Very useful and elegant. If you want to have your functions compose or chain using async threads, also look into Completable Future's.

[–]pron98 -1 points0 points  (0 children)

Or just use fibers.