-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add Option.all* & Result.all* helpers #7181
base: master
Are you sure you want to change the base?
Conversation
Ah I see this is basically rescript-lang/rescript-core#202 which I forgot to re-review, sorry about that! Build failed because of a code formatting issue.
|
This is called |
my rationale here is to keep it familiar by mimicking let (user, status) = await Promise.all2((getUser(id), getStatus(id)))
Result.all2((user, status)).map(((user, status)) => {
// ...
}) |
Yeah, I get it. Reproducing these kinds of design mistakes invites other issues though, such as confusion with |
And by the way we already have zip in Core.List. |
Yeah this implementation is looks like zip for sure.
|
|
||
let all = options => { | ||
let acc = [] | ||
let returnValue = ref(None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't that just be
let hasNone = ref(false)
instead? I would find that clearer.
BTW build failed because you need to check in the updated |
No description provided.