-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(Seq): Add sequenceResultA #254
Comments
Yep I agree this is a good idea. Would you like to submit a pull request for it? |
I guess arm could be twisted Some questions though.... I find the semantics of the laziness of that hard to reason about, unless you can express it crisply? (I'm thinking it should not be lazy) If it's not lazy, it needs to be materialized internally. If you're doing that, it's a bit daft not to just yield that given that the result is going to be So I think the answer might be to make an
Arguably if that was added, the Seq one could be obsoleted (unless it actually has well defined lazy semantics that is, but I doubt it) |
Yeah it seems like it's a Seq.fold, so I don't think it's going to be something that can lazily be evaluated.
Not necessarily because there are other enumerables beyond F#'s Array/List in the BCL and it's handy for those. |
Updates from spiking:
|
I prefer this so this won't change.
Yes unless you want to retarget for v5. |
Yeah, ultimately defaults matter so not a problem (and I do get that lots of people are happy with that layout)
I can make it API compatible in the context of this PR and prepare a follow-up PR to change the contract from Also happy to leave the original impl exactly as it is; I have no doubt it's much closer to the idioms used in other impl pieces
|
There's a List.sequenceResultA
I'd find use for a
Seq.sequenceResultA: Result<'t, 'e> seq -> Result<'t[], 'e[]>
This would align with how Async.Parallel works (accumulate outputs in a ResizeArray, yield an array) for efficiency
Example desired consumption
Example current workaround:
(This is literally what I have, and I have limited awareness of the Validation modules etc so maybe they offer a better workaround, but it does seem that in general there's a hole in the completeness of the operations hence raising this)
The text was updated successfully, but these errors were encountered: