Tom Davis
09/19/2023, 1:55 PMEither<Throwable, T>.getOrThrow(): T ? i've been using when() to change behavior on Left or Right but it's kinda verbose.pakoito
09/19/2023, 2:01 PMTom Davis
09/19/2023, 2:01 PMAlejandro Serrano.Mena
09/19/2023, 3:01 PMtheEitherValue.getOrElse { throw it }, which I find quite readable and not so verboseCLOVIS
09/20/2023, 7:53 AMeither.getOrElse { throw it }
and
either.recover { throw it }
?
To my knowledge, these behave the same?Alejandro Serrano.Mena
09/20/2023, 8:01 AMRaise<Error>.f(): A more often than Either<Error, A>, and in that case I just use fold to make a final throw