-
Notifications
You must be signed in to change notification settings - Fork 494
[Experiment] Let/Bind
#7351
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?
[Experiment] Let/Bind
#7351
Conversation
|
e1c033d to
baa2cef
Compare
9f3a771 to
2f1f5eb
Compare
2f1f5eb to
b4892d0
Compare
| Right $ | ||
| headSpine | ||
| (branches Vector.! (fromIntegral ix)) | ||
| (someValueOf DefaultUniData <$> ds) |
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.
You lost all your money and now live under the bridge, because you performed a linear operation before doing any costing for 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.
please, anything but bridge. haven't gone that far yet
| instance LetBuiltin DefaultUni where | ||
| letBuiltin _someVal@(Some (ValueOf uni x)) = | ||
| case uni of | ||
| DefaultUniList ty -> Right $ someValueOf ty <$> x |
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.
Likewise.
| | Constr !ann !Word64 ![Term name uni fun ann] | ||
| -- See Note [Supported case-expressions]. | ||
| | Case !ann !(Term name uni fun ann) !(Vector (Term name uni fun ann)) | ||
| | Let !ann ![name] !(Term name uni fun ann) |
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 discussed this here and it should be
| Let !ann ![name] !(Term name uni fun ann) !(Term name uni fun ann)
at which point you don't need Bind (right?).
Sorry for the confusion I caused!
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. Since we talked, I was pulled to do other things, so I haven't got chance to update yet.
But looking back now, and also seeing more PIR/PLC internals, I think your version of Let is better than what I have here in being more general and less ambiguous.
These are essentially multi-lambda and multi-app.
Don't merge
closes https://github.com/IntersectMBO/plutus-private/issues/1841