tginiotis
03/30/2018, 1:31 PMEither<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?:
return stringEither.fold({
it
}, {
it
})
tginiotis
03/30/2018, 1:33 PMtginiotis
03/30/2018, 2:17 PM.fold()
without arguments achieves the resulttginiotis
03/30/2018, 2:28 PMpakoito
03/30/2018, 3:08 PMpakoito
03/30/2018, 3:09 PMtginiotis
03/30/2018, 3:13 PMtginiotis
03/30/2018, 3:15 PMLeft
one it does not return it