Skip to content

Add Bool type in stdlib #213

@katat

Description

@katat

When creating a variable to represent a bool value, we have to make sure it is constrained as a boolean.

For example:

assert_eq(bit * (bit - 1), 0); // where bit is a field variable

To make the code more expressive by itself, we can add a bool type in stdlib to constrain the field variable as a boolean value.

For example:

use std::bits;

let bool = bits::Bool::new(1); // the new method should also constrain the argument value.

This Bool type can be an addition to the existing std::bits stdlib module.

Related: #201 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions