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
Summary
Currently, <a> | <b> is implemented as let $input = <a> in <b>, with some special rules for inferring $input for ommitted arguments. This allows for interesting uses -- such as referencing the left hand side in a deeply nested location on the right hand side.
A simpler approach inspired by PRQL would be to have a simple rule like <a> | f(<b...>) always becomes f(<b...>, <a>) (the left hand side becomes the last argument to the function on the right.
This would allow us to:
Eliminate the rules for inferring $input as an argument. In turn, this would simplify error messages when an argument is missing (instead of inferring $input and then reporting it isn't used).
Simplify the rules for implementing pipe.
Eliminate the concept of $input from what we need to document (in favor of the simpler explanation of pipe). Any examples that need it can be re-written (and likely clarified) using an explicit let binding and name.
Eliminate the case of the left hand side of a pipe not being used.
The text was updated successfully, but these errors were encountered:
Summary
Currently,
<a> | <b>
is implemented aslet $input = <a> in <b>
, with some special rules for inferring$input
for ommitted arguments. This allows for interesting uses -- such as referencing the left hand side in a deeply nested location on the right hand side.A simpler approach inspired by PRQL would be to have a simple rule like
<a> | f(<b...>)
always becomesf(<b...>, <a>)
(the left hand side becomes the last argument to the function on the right.This would allow us to:
$input
as an argument. In turn, this would simplify error messages when an argument is missing (instead of inferring$input
and then reporting it isn't used).$input
from what we need to document (in favor of the simpler explanation of pipe). Any examples that need it can be re-written (and likely clarified) using an explicitlet
binding and name.The text was updated successfully, but these errors were encountered: