Simon Frost
10/25/2023, 12:52 PMfun <T : Any?> Result<T>.toEither(): Either<Throwable, T> = this.fold(
{ Either.Right(it) },
{ Either.Left(it) }
)
If not, is there anything that speaks against adding this ?Alejandro Serrano.Mena
10/25/2023, 12:56 PMResult
is because of a throwing functionEither.catch { theThrowingFunction() }
Simon Frost
10/25/2023, 1:07 PMAlejandro Serrano.Mena
10/25/2023, 1:08 PMresult.fold(::Either.Right, ::Either.Left)
is quite small tooSimon Frost
10/25/2023, 1:15 PMAlejandro Serrano.Mena
10/25/2023, 1:19 PM