-
Notifications
You must be signed in to change notification settings - Fork 485
[Builtins] Allow casing on booleans and integers #7029
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
base: master
Are you sure you want to change the base?
[Builtins] Allow casing on booleans and integers #7029
Conversation
8358a8f
to
5244c96
Compare
5244c96
to
8b55532
Compare
8b55532
to
2344b92
Compare
2344b92
to
c0df0c1
Compare
/benchmark nofib |
1 similar comment
/benchmark nofib |
/benchmark lists |
1 similar comment
/benchmark lists |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on '27d2bc3905' (base) and 'c0df0c158b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on '27d2bc3905' (base) and 'c0df0c158b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '27d2bc3905' (base) and 'c0df0c158b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '27d2bc3905' (base) and 'c0df0c158b' (PR) Results table
|
c0df0c1
to
06d1a16
Compare
…to effectfully/builtins/allow-casing-on-booleans
/benchmark lists |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on '40b3e8c4d' (base) and '5f3483866' (PR) Results table
|
Performance looks pretty much unaffected. |
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.
One comment, otherwise looks good.
-- this type isn't supported at all). | ||
caseBuiltin :: UniOf term ~ uni => Some (ValueOf uni) -> Vector term -> Either Text term | ||
|
||
data CaserBuiltin uni = CaserBuiltin |
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.
It seems CaserBuiltin
should render the CaseBuiltin
class superfluous, since an instance of CaseBuiltin
can just be represented with a CaserBuiltin
value?
Also, why not newtype?
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.
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.
We do use CaseBuiltin as an actual constraint
Ok, so Case
is used to define how a universe normally handles casing on builtins, and Caser
exists so that it can vary based on protocol version. I guess that's fine, but not easy to tell, and their similar names don't help.
See this for a similar case.
Create a Note and link to it?
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.
This overall looks great. Very nice improvement to the language.
-- this type isn't supported at all). | ||
caseBuiltin :: UniOf term ~ uni => Some (ValueOf uni) -> Vector term -> Either Text term | ||
|
||
data CaserBuiltin uni = CaserBuiltin |
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.
We do use CaseBuiltin as an actual constraint
Ok, so Case
is used to define how a universe normally handles casing on builtins, and Caser
exists so that it can vary based on protocol version. I guess that's fine, but not easy to tell, and their similar names don't help.
See this for a similar case.
Create a Note and link to it?
I'll review this soon so that I actually have some idea of what's going on. If we're committed to releasing this then there are some other things that'll need to be done:
|
5f34838
to
2748dbb
Compare
…to effectfully/builtins/allow-casing-on-booleans
|
This adds support for casing on booleans and integers using
Case
, which is the first part of #6602.