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

Literal 0 and 1 at type Bit #913

Closed
brianhuffman opened this issue Sep 29, 2020 · 2 comments · Fixed by #914
Closed

Literal 0 and 1 at type Bit #913

brianhuffman opened this issue Sep 29, 2020 · 2 comments · Fixed by #914
Labels
language Changes or extensions to the language

Comments

@brianhuffman
Copy link
Contributor

It would be nice if we could write 0 and 1 as literals of type Bit, instead of having to write False and True.

It seems like it would be pretty easy to implement this; we would just add the instance rules Literal 0 Bit and Literal 1 Bit to the type checker.

@brianhuffman brianhuffman added the language Changes or extensions to the language label Sep 29, 2020
@yav
Copy link
Member

yav commented Sep 29, 2020

Seems reasonable to me.

brianhuffman pushed a commit that referenced this issue Sep 29, 2020
This adds the instance rule `(1 >= n) => Literal n Bit` to the
type checker.
brianhuffman pushed a commit that referenced this issue Sep 29, 2020
@brianhuffman
Copy link
Contributor Author

Thanks to @fandersengalois for suggesting this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Changes or extensions to the language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants