-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty optional fields-aware record operator variants (#1876)
* Add fields_all primop (doesn't ignore empty opts) * Add empty-opt aware record op variants to stdlib The design guideline around empty optional fields has been to make most normal record operation ignore them, to avoid issues like trying to list the field of a record and access them just to fail on an empty optional introduced by a contract, which we shouldn't care about. However, in some cases (typically operating on record contracts), users might want to actually take empty optional fields into account. Most primops were already existing in two variants internally (ignore empty opts and consider all fields). This commit just makes them available as clearly documented stdlib functions. * Add `has_field_all`, change `_all` -> `_with_opts` The previous commit introducing variants of record operators that don't ignore empty optional fields missed `has_field`, whose variant is added by this commit. As decided by the team in the weekly meeting, the `_all` suffix introduced in the previous commit has been changed to `_with_opts`, which is a bit longer but less confusing and more explicit.
- Loading branch information
Showing
10 changed files
with
250 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.