Overcoming Checked Exceptions in Java Lambdas

In Java 8, the long awaited Lambda came to live, making it easy(-er) to do FP in Java. One problem I came across is, that most Java code throws checked exceptions which leads to IMHO ugly try/catch blocks in lambdas: Function<A, B> fun = (a: A) -> { try { // some function call that trows checked exception$ return callFn(a); } catch (Exception e) { // return failure result } }; The Good, the Bad and the Ugly A really simple, but also not really nice option is to wrap thrown exceptions into an unchecked one: [Read More]