-
Notifications
You must be signed in to change notification settings - Fork 483
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
[Builtins] Add 'MakeBuiltinMeaning' and type errors doctests #4649
[Builtins] Add 'MakeBuiltinMeaning' and type errors doctests #4649
Conversation
8b7de14
to
1fa9f51
Compare
Sorry, don't review yet, I need to fix something. |
1fa9f51
to
108bac9
Compare
/benchmark plutus-benchmark:validation |
Comparing benchmark results of 'plutus-benchmark:validation' on '207a979bd' (base) and '108bac959' (PR) Results table
|
^ looks like a tiny speedup, but I don't see why this PR would give us a speedup, so must be noise. Ready for review. |
-- <interactive>:1:1: error: | ||
-- • A built-in function must take at least one type or term argument | ||
-- ‘Bool’ is a built-in type so you can embed any of its values as a constant | ||
-- If you still want a built-in function, add a dummy ‘()’ argument |
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 would be nice to turn those into actual doctests, but that's definitely not for now.
-- Are you trying to define a polymorphic built-in function over a polymorphic type? | ||
-- In that case you need to wrap all polymorphic built-in types having type variables | ||
-- in them with either ‘SomeConstant’ or ‘Opaque’ depending on whether its the type | ||
-- of an argument or the type of the result, respectively |
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 sounds like the distinction between SomeConstant
and Opaque
is that one is for argument and the other is for result, but that's not the case, right?
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's not the case, but previously it was the case that if you were dealing with a polymorphic built-in type, you had to always use SomeConstant
for the argument and Opaque
for the result for efficiency reasons. I'm not sure if there's any difference now that we've done so much work on making sure everything related to builtins is properly inlined. I will check that separately. Created PLT-290.
This polishes the
PlutusCore.Builtin.Meaning
module and adds another tool toPlutusCore.Builtin.Debug
allowing us to debug the wholeBuiltinMeaning
inference pipeline.