-
Notifications
You must be signed in to change notification settings - Fork 103
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
Type-level _as_int
functions for enumerations?
#490
Comments
It's not currently possible. Would need to think about the syntax in types a bit. |
It's probably only marginally useful and might not be worth compilcating the language. I have a use case in the implementation of Zc* where that would add more type-safety (or more specifically, let me get away without |
PS, just to double-check: this is not even possible with the autogenerated map to numbers if the user simply defines |
No, we don't lift enumerations to the type level at all. |
There's no theoretical reason why we couldn't. It might make Coq generation more complicated with more things at the type level, but enumerations are essentially equivalent to a limited set of numbers. |
Enums come with a mapping to other data types, e.g.
The mapping between the symbolic name and the corresponding
int
is available at compile time, so I should be able to do something like thisIs this currently possible? There does not seem to be a type-level
E_as_int
.The text was updated successfully, but these errors were encountered: