After mapping over an `Either<String, typeB>...
# arrow
t
After mapping over an
Either<String, typeB>
, I ended up with an
Either<String, String>
. Is there a simple way of returning the resulting String whichever is there, i.e. to convert the
Either<String, String>
to a
String
? Or should a fold like this be used?:
Copy code
return stringEither.fold({
    it
}, {
    it
})
yeah, probably the fold makes most sense
apparently calling
.fold()
without arguments achieves the result
or not
p
seems okay to me 😄
fold w/o parameters should not compile
t
.fold() without parameters does compile though
but when the value is a
Left
one it does not return it