-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Generalize Task.sequence
for arbitrary collections
#166
Comments
I don't dislike the idea. I'm generally fearful of But if we do this, then |
You're right. Then should we keep |
Yes, we can still drop it. |
@guersam also Coeval.sequence :-) |
Note - I think zipList should not ne removed after all. And signature should stay the same. This is for consistency with Observable (I remembered the reason for why it's there :-)) |
I mean, on Observablr the zip operation is not like map2 or mapBoth. And zipList makes sense for Observable, whereas sequence and gather do not. |
|
|
As the order doesn't matter, how about replacing In this case, it would be better to find another way to determine the end of computation not relying on |
@guersam sorry for the late response, I'm caught up with other things and have high latency these days. I do not want us to use another chunk of
Frankly, I'd go with number 2. This is because people would use |
Btw - if you want to work on this, don't wait for me to approve - like do something, submit a PR and then we can also talk on the PR. When you've got time of course. |
@guersam - I want to release this as part of release |
I've modified the code itself, but additional tests and docs are not done yet. Will open a PR soon with current changes to discuss remains. |
* (WIP) #166 Generalize `Task.sequence` for arbitrary collections * `{Task,Coeval}.zipList` takes varargs to match `Observable.zipList` * Add `Task.traverse` * Increase GC timeout for tck spec 313 in Travis CI * Add guersam to AUTHORS * Update SBT to 0.13.12 * Increase timeout for TCK spec 313 * Ensure that Task.gatherUnordered runs over an iterator * Replace hardcoded main scala version with Travis config
should this be close? |
Oh, it wasn't automatically closed... thanks for pointing it out. |
@guersam @hepin1989 yes, it's deployed in 2.0.0, thanks. |
Task.sequence
takesSeq[Task[A]]
and gives backTask[List[A]]
, which might not be desirable in all cases.Generalizing it as
def sequence[A, M[X] <: TraversableOnce[X]: CanBuildFrom](xs: M[Task[A]]): Task[M[A]]
would be helpful, as well as addingtraverse: M[A] => (A => Task[B]) => Task[M[A]]
in the same way.The text was updated successfully, but these errors were encountered: