-
Notifications
You must be signed in to change notification settings - Fork 64
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
Seungheonoh/moveledger #805
Conversation
Plutarch/Repr/Data.hs
Outdated
) | ||
~ () | ||
|
||
class (PNormalIsData' a (PInnest a), PInnest a ~ PData) => PNormalIsData a |
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.
any idea for better name?
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.
PInnermostIsData
?
New structure can be somewhat painful if we want to access nested structures. like |
Plutarch/Repr/Data.hs
Outdated
) | ||
~ () | ||
|
||
class (PNormalIsData' a (PInnest a), PInnest a ~ PData) => PNormalIsData a |
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.
PInnermostIsData
?
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.
Didn't read too much into internals, do we still get that magical optimization that extracting multiple record fields traverses the list only once?
Plutarch/Internal/TermCont.hs
Outdated
findPlaceholder (RPlaceHolder idx') = idx == idx' | ||
findPlaceholder (RConstr _ xs) = any findPlaceholder xs | ||
findPlaceholder (RCase x xs) = any findPlaceholder (x : xs) | ||
findPlaceholder _ = False |
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.
Wildcard _
is an anti-pattern in AST traversals like this, please name constructors
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.
Yes, this.
data POutputDatum (s :: S) | ||
= PNoOutputDatum (Term s (PDataRecord '[])) | ||
| POutputDatumHash (Term s (PDataRecord '["datumHash" ':= PDatumHash])) | ||
= PNoOutputDatum | ||
| POutputDatumHash | ||
{ poutputDatum'datumHash :: Term s (PAsData PDatumHash) | ||
} | ||
| -- | Inline datum as per | ||
-- [CIP-0032](https://github.com/cardano-foundation/CIPs/blob/master/CIP-0032/README.md) | ||
POutputDatum (Term s (PDataRecord '["outputDatum" ':= PDatum])) | ||
POutputDatum | ||
{ poutputDatum'outputDatum :: Term s PDatum | ||
} |
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 generates partial record selectors, not a huge fan
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.
In the future, we should have better interface to each fields using optics
. I want to let it slip for release at this point
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 should just remove them and have "unnamed sop" (whatever the name is), e.g. PScriptPurpose
is already doing that
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.
names follow from definitions of PlutusLedgerApi. I think it's better to have this.
It's less of a problem for us because this explodes when Haskell gets compiled and not on UPLC result.
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.
Oh right, this will straight up always error during plutarch compilation
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.
Yeah, I don't worry about it too much because of it
] | ||
] | ||
] | ||
-- , plutarchGolden |
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.
All of that commented out code in testlib should go
Yes, and it does this without any typelevel stuff. |
372337c
to
a97cb93
Compare
a97cb93
to
cf5fdfe
Compare
Redo ledger types to use new derivation strategies.
Remove PTryFrom