-
Notifications
You must be signed in to change notification settings - Fork 482
[Builtins] Add 'ListToConstr' and 'DataToConstr' #5704
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
Conversation
|
/benchmark plutus-benchmark:lists |
|
Click here to check the status of your benchmark. |
…to effectfully/builtins/add-ListToConstr
|
/benchmark plutus-benchmark:lists |
|
Click here to check the status of your benchmark. |
|
Comparing benchmark results of 'plutus-benchmark:lists' on 'b8a74e7b4' (base) and '9d99fc6ed' (PR) Results table
|
|
/benchmark plutus-benchmark:lists |
|
Click here to check the status of your benchmark. |
|
Comparing benchmark results of 'plutus-benchmark:lists' on 'b8a74e7b4' (base) and 'a8183017d' (PR) Results table
|
|
/benchmark plutus-benchmark:lists |
|
Click here to check the status of your benchmark. |
|
Comparing benchmark results of 'plutus-benchmark:lists' on 'b8a74e7b4' (base) and 'a8183017d' (PR) Results table
|
a161078 to
db5cabb
Compare
|
We are not doing this as per #5711, hence closing. |
This is a competitor of #5486, let's see how it performs.
This adds the
listToConstrbuiltin whose Plutus type isThe idea is that we can use this builtin to implement faster pattern matching over built-in lists by piggy-backing on
casethat we use for pattern matching over sums-of-products:Implementation-wise this requires us to add the following class:
and add it to
HasMeaningIn uni val.The meaning of the
listToConstrbuiltin is implemented as follows:i.e. it simply turns the outer constructor of a list into an SOP term leaving all other constructors of the list intact.
The only interesting remaining part is that we make
matchListanInternalbuiltin (i.e. aNOINLINEone) and tell the plugin to replace that builtin with the definition ofmatchListgiven above.