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

Added Task.parallel #224

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@TheSeamau5
Contributor

TheSeamau5 commented Apr 22, 2015

Added simple implementation for Task.parallel. This function will run
a lists of tasks in parallel and will return a task that computes a
list of ThreadIDs.

Solves this issue: https://github.com/elm-lang/core/issues/223

As @johnpmayer pointed out here, further down the road, we may want to get an MVar implementation a la Haskell in Elm. This would give more fine grain control and allow communication between "threads". Currently, those ThreadID values are completely useless (aside from debugging) but they could be put to good use.

But, in the meantime, this is not a bad option and it's worth adding to the core library due to how common this use case is.

Added Task.parallel
Added simple implementation for `Task.parallel`. This function will run
a lists of tasks in parallel and will return a task that computes a
list of ThreadIDs.
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Apr 26, 2015

Member

For the reasons, described in that thread here, I'd like to wait on a proper implementation of this. For now, people can spawn a bunch of stuff or make a library. I think adding the wrong semantics to a core library is not a good thing to do.

Member

evancz commented Apr 26, 2015

For the reasons, described in that thread here, I'd like to wait on a proper implementation of this. For now, people can spawn a bunch of stuff or make a library. I think adding the wrong semantics to a core library is not a good thing to do.

@evancz evancz closed this Apr 26, 2015

@TheSeamau5

This comment has been minimized.

Show comment
Hide comment
@TheSeamau5

TheSeamau5 Apr 26, 2015

Contributor

Cool. Anyways, if people need this sort of thing, there's a library:
http://package.elm-lang.org/packages/TheSeamau5/elm-task-extra/2.0.0
It has parallel and optional and a few others.

Contributor

TheSeamau5 commented Apr 26, 2015

Cool. Anyways, if people need this sort of thing, there's a library:
http://package.elm-lang.org/packages/TheSeamau5/elm-task-extra/2.0.0
It has parallel and optional and a few others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment