Closed jamiebuilds closed 7 years ago
I don't feel specifying names here makes sense, as they would be unobservable if partial application uses eager evaluation (which is the current consensus view). Also, you would not be able to set a breakpoint that could be hit inside of the partially applied function call.
Type checkers would not have this issue, as they can determine the resulting signature of the partial function and use the argument names of the original function. I've already experimented with this in TypeScript and its fairly trivial.
Without partial application, using the pipeline operator, you need to create extra functions, which is bad. But there's an argument to be made that having names for the parameters is good.
This proposal gets rid of the extra functions, but it's also gets rid of the names which is not the primary goal.
What if we used an alternate syntax (or extended the proposed syntax) to require (or allow) names for the placeholders:
I personally think that this is easier to read, but more importantly there is value for tooling.
Example: DevTools
If you want to create a conditional breakpoint, it would be useful to have a name to go off of.
Example: Type Checkers