You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The source code of both implementations are almost identical. The only difference is that Functjonal uses Exception as bound and Apache Commons Lang3 (below referred to as Lang3) uses Throwable, which is more general.
I propose to
remove the functions package from Functjonal
add a Apache Commons Lang3 dependency to Functjonal
use Failable* instead of Fragile* everywhere
Theoretically the dependency could be avoided by removing all fragile related functions, but there are still some useful functions which are not provided by Lang3 or interact with Functjonal (e.g. Result.Try).
Pro:
Java has a nominal type system, so two identical interfaces are not compatible. That will probably result in pain as soon as some dependency of a project uses Lang3.
Lang3 already has failable alternatives for most (probably all, but I didn't check that) of the standard functional interfaces in java.util.function whereas Functjonal only provides a small selection.
Lang3 also provides some useful helpers, for example converting a FailableX to an X by rethrowing all exceptions as RuntimeException. It also provides a FailableStream.
Cons:
Adding a Lang3 dependency to Functjonal.
This is a breaking change for users of Functjonal.
There are currently only two known uses of Functjonal:
VEVOS_Simulation, which currently has one occurrence of a Fragile interfaces and 5 uses of Fragile related methods.
Therefore, the consequences of this breaking change should be quite small.
The text was updated successfully, but these errors were encountered:
The source code of both implementations are almost identical. The only difference is that Functjonal uses
Exception
as bound and Apache Commons Lang3 (below referred to as Lang3) usesThrowable
, which is more general.I propose to
Theoretically the dependency could be avoided by removing all fragile related functions, but there are still some useful functions which are not provided by Lang3 or interact with Functjonal (e.g.
Result.Try
).Pro:
java.util.function
whereas Functjonal only provides a small selection.FailableStream
.Cons:
There are currently only two known uses of Functjonal:
Therefore, the consequences of this breaking change should be quite small.
The text was updated successfully, but these errors were encountered: