I have an Either<A, B>. I want to call .map ...
# arrow
j
I have an Either<A, B>. I want to call .map to make it an <A, C> but the map may produce an A. Is there a way to do this with map or is there something else? ex;
Copy code
myEither.map { 
  try { 
    it.toC() 
  } catch (e: Exception) { 
    A() 
  } 
}
ohh looks like I want flatMap and just call .right() or .left() on my C and A respectively.
👌 1
p
either.catch may be helpful too
âž• 1