You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeConcurrently::*->*-- newtype of IO, instances run things in parallelinstanceApplicativeConcurrently-- <*> = concurrently (wait for both)instanceAlternativeConcurrently-- <|> = race (wait for first)
It could have
instanceSemialignConcurrently-- align = ??? (wait for first, but keep both if the other is done)
When one task completes, a cancel exception is thrown to the other.
But if the other is already done before that signal is received it can give back both.
With that said, this is probably not very useful since you're very unlikely to have two tasks finish within such a short overlapping time frame. Maybe if you had a long uninterruptible call this would be useful. A timed version might be useful:
-- Race, once the first completes, if the other completes within the timeout give back both results???::Double{- timeout after first result -}->IOa->IOb->IO (Theseab)
Or you could imagine some library where a task can choose to submit a result and continue before sending a kill signal (which could achieve the timed version).
The text was updated successfully, but these errors were encountered:
But I'm not sure where it belongs. Adding async dependency to these (nor semialign) doesn't feel right. Adding these dependency to async probably won't happen, but feels more correct.
I'm not sure this is useful, but it might be interesting or show up elsewhere.
https://hackage.haskell.org/package/async provides:
It could have
When one task completes, a cancel exception is thrown to the other.
But if the other is already done before that signal is received it can give back both.
With that said, this is probably not very useful since you're very unlikely to have two tasks finish within such a short overlapping time frame. Maybe if you had a long uninterruptible call this would be useful. A timed version might be useful:
Or you could imagine some library where a task can choose to submit a result and continue before sending a kill signal (which could achieve the timed version).
The text was updated successfully, but these errors were encountered: