But unfortunately, many ResultSet operations can throw SQLException. So we created a `ConsumerE<T, E extends Exception>` to use in such cases, so that we can allow some lambdas to throw exceptions where it is sensible (InterruptedException, SQLException, and IOException being the major culprits).
Pretty soon we ended up with FunctionE, BiFunctionE, and so on.
At the same time, we found a need for more interfaces, such as ObjIntFunction<T, R>, that are not provided by JDK 8.
Rather than continuing to implement these on an as-needed basis, I decided to just solve the problem once-and-for-all by creating this library.
Code generation is in my experience a clear indication that the problem you have has not really been understood.
I took a look functionaljava, and it doesn't provide the following:
Either<IOExeption, String> line = Either.from(reader::getLine);
For that, you would need to have a signature like: static <E extends Exception, R> Either<E, R> from(NilToObjE<R, E> f);
That's exactly what this library gives you.Why? Even if a rewrite/translation of such a small system was perfectly possible, it's not necessary because of the excellent Scala -> Java interop.
public delegate void Action<in T1>(T1 arg1);
public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
public delegate void Action<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3);
public delegate TRet Func<out TRet>();
public delegate TRet Func<in T1, out TRet>(T arg1);
public delegate TRet Func<in T1, in T2, out TRet>(T1 arg1, T2 arg2);
public delegate TRet Func<in T1, in T2, in T3, out TRet>(T1 arg1, T2 arg2, T3 arg3);