You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#6563 proposes to add support for true higher-order builtins, however not only do we not seem to need that, it is also really complex and very inefficient in the general case. This issue proposes a different approach.
What we can do is add builtins that can call other builtins, as opposed to general UPLC functions. Consider unionValue: in its current form we could express it as
unionValue = unionWith (unionWith (+))
but if we make unionWith a builtin that can take other builtins (that can take other builtins...), then this whole expression is just a single builtin call doing a builtin call (doing a builtin call...), i.e. really efficient.
It seems like this is implementable in UPLC (note however that we probably want to be able to handle arbitrary partially applied builtins as arguments to other builtins), assigning such builtins a reasonable non-parametricity-breaking type is gonna be quite a challenge though.
But this is worth an experiment at least, given how much that would speed everything up and increase the expressive power of the builtins machinery.
The text was updated successfully, but these errors were encountered:
I think we only wanted this for faster Value, but since Value has plenty of invariants and complexity, we probably want to have a dedicated built-in type because of that as per #6585, I'm seeing much utility for limited higher-order builtins. So closing the issue, we can always reopen it later if we find a use case.
#6563 proposes to add support for true higher-order builtins, however not only do we not seem to need that, it is also really complex and very inefficient in the general case. This issue proposes a different approach.
What we can do is add builtins that can call other builtins, as opposed to general UPLC functions. Consider
unionValue
: in its current form we could express it asbut if we make
unionWith
a builtin that can take other builtins (that can take other builtins...), then this whole expression is just a single builtin call doing a builtin call (doing a builtin call...), i.e. really efficient.It seems like this is implementable in UPLC (note however that we probably want to be able to handle arbitrary partially applied builtins as arguments to other builtins), assigning such builtins a reasonable non-parametricity-breaking type is gonna be quite a challenge though.
But this is worth an experiment at least, given how much that would speed everything up and increase the expressive power of the builtins machinery.
The text was updated successfully, but these errors were encountered: