-
Notifications
You must be signed in to change notification settings - Fork 485
Add BuiltinValue type to plutus-core #7225
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?
Conversation
|
Ready for review. This is a naive implementation, where Nonetheless wen can merge this first, and if we need a different representation of |
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.
Everything looks reasonable besides some nitpicks.
conValue = | ||
Value.fromList | ||
<$> conList | ||
(DefaultUniPair |
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 can probably use some better syntax for value. Just using 3tuple for each entry would be more readable.
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.
That may be slightly better-looking, but then we won't be able to reuse the built-in list parser since a built-in list can't contain a 3-tuple. I'll leave this as future work.
(DefaultUniPair DefaultUniByteString DefaultUniInteger) | ||
) | ||
) | ||
conValue = Value.fromList <$> conList knownUni |
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.
Can you explain this change? I remember I wasn't sure about the former implementation, so I'd like to understand how this all works.
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.
knownUni :: uni `Contains` a => uni (Esc a)
, so it can be instantiated to any uni (Esc a)
as long as uni `Contains` a
. So there's no need to specify the concrete type.
@@ -118,6 +119,7 @@ data DefaultUni a where | |||
DefaultUniBLS12_381_G1_Element :: DefaultUni (Esc BLS12_381.G1.Element) | |||
DefaultUniBLS12_381_G2_Element :: DefaultUni (Esc BLS12_381.G2.Element) | |||
DefaultUniBLS12_381_MlResult :: DefaultUni (Esc BLS12_381.Pairing.MlResult) | |||
DefaultUniValue :: DefaultUni (Esc Value) |
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.
I don't recall the discussion - do you have a pointer? It's always called Value in plutus, and I'm hesitant to make a name 80% longer unless there's a clear advantage.
Fixes https://github.com/IntersectMBO/plutus-private/issues/1690