-
Notifications
You must be signed in to change notification settings - Fork 463
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
Bool as unboxed variant payload #6231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one subtle thing is when there's both a bool literal and "bool".
Just need to know it's been tested.
Second: as a user how do I know what types are supported? (Question about docs, or at these stage info that will go in the website: do we have enough reminders to not forget bool in the docs).
I think the code is very likely all correct as it's just one more pattern following the other patterns.
In terms of overlap, the one thing to double check is that this does not introduce any more overlap than the one mentioned above: bool literal and bool type.
If I may cautiously express an opinion, I think it might be a bit different from String and |
I think the idea is to make both expressible. Not 100% sure of the answer. |
I think it's confusing to allow strings and numbers but not booleans, purely from a "this is what I'd expect as an end user" perspective. Even if it's expressible with the two cases, they both require using as-annotations and adding them both explicitly to cover the bool case. Feels like an odd technicality when the relation a JS dev has to string/number/bool are that they're all primitives, not whether they conceptually fit 100% into an ADT or not. I'm of course fine with not having it if other's don't agree. We can also just wait and see if this confusion surfaces organically. |
I'm excited for the possibility of involving an AI arbiter if we can't reach a consensus! |
If we can't reach consensus we should just wait for this to potentially surface as an issue from the community. After all this is my "hunch" and it might or might not be correct. |
Closing this, can re-open if need surfaces organically. |
I think this one is worth it as well. Not only because the user expects it, but the handling is a bit nicer if I don't need to convert between |
bool
didn't seem to be implemented for unboxed variants. This PR is trying to enable this:Not sure if this is correct, looking for some guidance @cristianoc .