I want to do something similar to a Either.map5 on several Either types. But, instead of keeping just the first Left in case of my Eithers being Left, I want to keep all the Left Either contents, and put them into a List.
Basically instead of the Either<L,R> result of map5 I would like to have a Either<List,R>.
Is there a out-of-the-box way of doing this with dartz ?
I've created my own solution to my needs, here it is:
Basically, if any of the provided Eithers is a Left I return a left with the list of Left contents, otherwise I call the bundled map5 function and map the left from the final result to an empty list just to match the expected return type, as I already know it is not a left anyways.