Skip to content
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

feat(stdlib)!: update stdlib functions to return bool where appropriate #1409

Merged
merged 2 commits into from
May 26, 2023

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves

Summary*

This PR sets out to enforce proper types on several stdlib functions which return Field to represent a boolean value. I assume this was done before we had a proper boolean type but it should now be updated.

This isn't time sensitive so we can merge this whenever we feel it's appropriate to make a breaking change to the stdlib.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

The function signatures for several stdlib functions has changed and so code examples must be updated.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@TomAFrench TomAFrench changed the title feat(stdlib)!: return update stdlib functions to return bool where appropriate feat(stdlib)!: update stdlib functions to return bool where appropriate May 26, 2023
@TomAFrench
Copy link
Member Author

We could also take this opportunity to remove merkle::check_membership as it's pretty redundant with merkle::compute_merkle_root.

@kevaundray
Copy link
Contributor

kevaundray commented May 26, 2023

One thing on my mind with this PR is; who is applying the relevant constraints.

ie does Noir constrain it to be a boolean or does the backend calling it constrain it to be a boolean based on the function being called. In our case right now the backends is implicitly doing it, but perhaps we need to put this information somewhere so that folks don't need to dig into the codebase.

(This is not blocking for this PR)

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevaundray
Copy link
Contributor

We could also take this opportunity to remove merkle::check_membership as it's pretty redundant with merkle::compute_merkle_root.

Gonna merge this, lets open up a new PR for that ser :)

@kevaundray kevaundray added this pull request to the merge queue May 26, 2023
Merged via the queue into master with commit 2b2be1e May 26, 2023
@kevaundray kevaundray deleted the stdlib-boolean-returns branch May 26, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants