Filip Piechowski
01/19/2023, 3:05 PMeither { … } block and catch any exceptions inside like:
either {
Either.catch {
// potentially throwing code
}.bind()
}
Is there a builtin function for such case? something like
eitherCatch { … }simon.vergauwen
01/19/2023, 3:14 PMEither is typically over E the function is currently prototyped as:
either<Error, A> {
val a: A = catch(
{ // throwing code },
{ e: Throwable ->
// shift(e.toError())
// transform(e).bind()
// return fallback A
})
a
}