dave08
02/22/2023, 2:22 PMbind()
to in an either? Is there only Either<SomeFailure, Unit>
or maybe something made for this purpose?simon.vergauwen
02/22/2023, 2:24 PMEither<SomeFailure, Unit>
is the best accurate return type for this.Stylianos Gakis
02/22/2023, 2:25 PMEither<Unit, Unit>
normal, or just an indicator that I probably want something more smart for Left
?simon.vergauwen
02/22/2023, 2:31 PMobject Failed
that at some point you mapLeft
to align errors into a different error hierarchy, or Throwable
with Either.catch
in case I don't know what goes wrong. Being aware that with Throwable
you don't swallow, and/or send an alert/log to a metric service.
In any other case where there is some result but no clear error, so Either<Unit, A>
is a good indication you probably want A?
.