We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
guard let
A follow-up to #1301, swift has this other nice piece of sugar, guard let. Here's what it might look like in reason
guard let Some(val) = something else { None }; // ...rest of the code
which translates to
switch something { | Some(val) => { // ...rest of the code } | _ => None }
More generally
guard let %pattern = %value else { %if_not_matched_expression }; %if_matched_expression
becomes
switch %value { | %pattern => %if_matched_expression | _ => %if_not_matched_expression }
early returns can be super helpful for readability imo.
ppx_let does a similar kind of thing, albeit with somewhat more magic https://github.com/janestreet/ppx_let
ppx_let
The text was updated successfully, but these errors were encountered:
guard
unlikely we'll do this
Sorry, something went wrong.
No branches or pull requests
A follow-up to #1301, swift has this other nice piece of sugar,
guard let
.Here's what it might look like in reason
which translates to
More generally
becomes
early returns can be super helpful for readability imo.
ppx_let
does a similar kind of thing, albeit with somewhat more magic https://github.com/janestreet/ppx_letThe text was updated successfully, but these errors were encountered: