Ah so you already had an either inside try. Then j...
# arrow
j
Ah so you already had an either inside try. Then just go
toEither
+
flatten
.
flatten
is an alias to
flatMap(::identity)
and is used to, well, flatten out nested structures. This will only work if the
Left
value is of the same type. Also please consider what @raulraja refers to,
Try
is very much inferior to
suspend
or
IO
. I took a while to explain it in a bit more detail here: https://github.com/arrow-kt/arrow/issues/1822#issuecomment-559783940 With a bifunctor IO this will be even nicer.