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
We are currently using the ? suffix operator to desugar to Result.try, which allows users to propagate errors early. We want to move to supporting the try prefix keyword, which can be used in values and in pipelines. Example usage looks like the following:
try usages early return errors to the nearest function boundary, by basically desugaring to
when result isErr err -> return Err err
Ok val ->
# rest of the body using val
We need #7104 to be implemented first to implement try.
We should not treat try as a simple desugaring to Result.try, as it needs to eventually work with pure and effectful code. That's why we should desugar to a when statement instead.
The text was updated successfully, but these errors were encountered:
We are currently using the ? suffix operator to desugar to
Result.try
, which allows users to propagate errors early. We want to move to supporting thetry
prefix keyword, which can be used in values and in pipelines. Example usage looks like the following:try
usages early return errors to the nearest function boundary, by basically desugaring toWe need #7104 to be implemented first to implement
try
.We should not treat
try
as a simple desugaring toResult.try
, as it needs to eventually work with pure and effectful code. That's why we should desugar to awhen
statement instead.The text was updated successfully, but these errors were encountered: