Closed sgoeminn closed 7 years ago
Hey @sgoeminn, which version are you using? The latest cyclops-react 2.x has a static flatten method that can be used as follows
Try<String, Throwable> r = Try.of(Try.of("r")).to(Try::flatten);
This is guaranteed to be type-safe. We can backport this to standalone cyclops-try if needed.
@johnmcclean-aol I'm using version 7.2.3 (http://static.javadoc.io/com.aol.cyclops/cyclops-try/7.2.3/com/aol/cyclops/trycatch/Try.html#flatten--)
The following code is expected to compile. However, it returns a Try<Try<String, Throwable>, Throwable>>.
Try<String, Throwable> r = Try.of(Try.of("r")).flatten();
Expecting interface to specify a type similar to the return type of flatMap:
public <R> Try<R,X> flatten()
with two implicit cases: