-
Notifications
You must be signed in to change notification settings - Fork 486
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
Add PlutusTx.Data.List.destructList #6945
base: master
Are you sure you want to change the base?
Conversation
((\tail -> tail (tail (force tailList nt))) | ||
(\eta -> force tailList eta))) | ||
(unIData (force headList nt))) | ||
(force tailList (unListData d)))) |
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's a lot of forcing, why not bind force tailList
and force headList
to a variable? Or do you expect CSE to clean it up? Particularly when you already seem to do that in (\eta -> force tailList eta)
. Why the eta-expansion btw?
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 don't CSE work-free terms such as force tailList
. As mentioned in the CSE Note, doing so may reduce size but always increases cost, and CSE currently favors smaller cost. I don't think there is a way to manually bind force tailList
to a variable, is there?
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 really work-free, since both Force
and Builtin
have a cost. Var
has a cost too, but it's 1 against 2, so binding it to a variable should be an overall cost reduction.
I don't think there is a way to manually bind force tailList to a variable, is there?
I don't know.
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's also LamAbs
and App
, though perhaps if a builtin is forced many times, it may be worth hoisting it.
This seems not only useful for @adamsmo's scripts, but also useful in general. See Haddock for more details.
Closes #6936