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

Should race be symmetrical to parallel? #18

Open
rpominov opened this issue Aug 22, 2016 · 0 comments
Open

Should race be symmetrical to parallel? #18

rpominov opened this issue Aug 22, 2016 · 0 comments

Comments

@rpominov
Copy link
Owner

rpominov commented Aug 22, 2016

It's easier to show using type signatures. Should it be like the following?

parallel(tasks: Array<Task<S, F>>): Task<Array<S>, F>
race    (tasks: Array<Task<S, F>>): Task<S, Array<F>>

The description of race would change from:

Given array of tasks creates a task that completes with the earliest successful or failure value

to:

Given array of tasks creates a task that completes with the earliest successful value or, if all tasks fail, with array of failure values.

I don't have strong opinion yet, just discovered that we could make parallel and race symmetrical, and thought that maybe it's a good idea. Need to consider all the use-cases...

@rpominov rpominov added idea and removed raw idea labels Oct 3, 2016
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

1 participant