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

Rename Bool -> Truth #118

Closed
cdsmith opened this issue Feb 4, 2016 · 2 comments
Closed

Rename Bool -> Truth #118

cdsmith opened this issue Feb 4, 2016 · 2 comments

Comments

@cdsmith
Copy link
Collaborator

cdsmith commented Feb 4, 2016

The Bool type is programming jargon (based on the last name of a logician). I believe it should be renamed to Truth instead, which will be more obvious.

@cdsmith
Copy link
Collaborator Author

cdsmith commented Feb 6, 2016

I find myself wondering how possible this is. If we defined a different type instead of Bool, and then reimplemented ifThenElse from the RebindableSyntax extension, would this apply to guards and pattern matching as well?

If not, we could achieve essentially the same thing using the same approach as Program: define a type synonym, and then postprocess the compiler output to replace all occurrences of Bool with Truth.

@cdsmith cdsmith closed this as completed in 2779e3f Feb 7, 2016
@cdsmith
Copy link
Collaborator Author

cdsmith commented Feb 7, 2016

This had to be done with the postprocessing trick, since RebindableSyntax still expects (==) to return Bool for pattern matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant