-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a contract node to the AST (#1955)
* Add CustomContract node to the AST This commit continues the work of properly separating custom contracts in the AST, in order to maintain more run-time information and be able, in the long run, to perform operations like boolean `or` on a larger class of contracts and to provide better error messages in some situations. This commit focuses on predicates, built using the `std.contract.from_predicate` which now acts as some kind of type constructor. `%contract/apply%` then performs the conversion of this predicate to a generic custom contract (a partial identity function). Note that this is a backward-incompatible change on paper, because before one could apply a custom contract built from a predicate as a function (taking a label and a value, and returning a new value). However, in practice, it's not officially supported - users are requested to use `std.contract.apply` to manipulate contracts - and thus we don't expect actual breakage to happen. * Update core/src/term/mod.rs Co-authored-by: jneem <[email protected]> --------- Co-authored-by: jneem <[email protected]>
- Loading branch information
Showing
12 changed files
with
216 additions
and
59 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
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.