I have an `Either<NonEmptyList<A>, B>` that I got ...
# arrow
c
I have an
Either<NonEmptyList<A>, B>
that I got from a function that validates my inputs. I want to transform
B
into
C
. Doing so requires more validations, so I'll get a type of
Either<NonEmptyList<A>, C>
. The
A
s are typed errors that inherit from the same base class. I want to accumulate the errors. I believe that
flatMap
overwrites the first
NonEmptyList<A>
with the second one. Is
bind
and
zipOrAccumulate
the way to go?
a
yes, any accumulation function would have the result you expect
p
When you have a B to transform, you won't have any existing As from that Either to merge or accumulate, so a flat map would suffice, no?
1