Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to also combine errors #27

Open
ad-si opened this issue Sep 1, 2021 · 1 comment
Open

Add function to also combine errors #27

ad-si opened this issue Sep 1, 2021 · 1 comment

Comments

@ad-si
Copy link

ad-si commented Sep 1, 2021

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-bird
Copy link

lue-bird commented Dec 5, 2021

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 is Nonempty
  • also the input results are Results with Nonempty errors

You could throw a PR in there with a version fromCombinedList (short for List.map fromResult >> combineList)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants