Add function to also combine errors
ad-si opened this issue · comments
Adrian Sieber commented
There already exists:
combine : List (Result x a) -> Result x (List a)
But I'm missing a
combineErr : List (Result x a) -> Result (List x) (List a)
Should this be added?
lue commented
ResultME.combineList
from the-sett's error-handling is similar
type alias ResultME err a =
Result (Nonempty err) a
combineList : List (ResultME err a) -> ResultME err (List a)
- The error list in the combined
Result
isNonempty
- also the input results are
Result
s withNonempty
errors
You could throw a PR in there with a version fromCombinedList
(short for List.map fromResult >> combineList
)