I have to make an array of IO calls in parallel, and merge the contents of the call if successful. If one fails the others get processed as per normal, but an error message.
My thought process on how this can be implemented:
Array<TE<E, A>> -> TE<E, Array<A>> -> TE<E, MergedA> -> [E, A]
What I'm currently doing:
I am currently sequencing an array of TE, but any failure in the chain will yield a left.
pipe(
sequenceT(TE.taskEither)(arrayofTE), //TE<E,A>[] -> TE<E,A[]>
TE.map(mergeFn), //TE<E, A[]> -> TE<E, MergedA>
???
)
How can I stop the short circuiting?