Basically, what would happen when you call a function with less parameters than it requires is that it returns a new function, which takes whichever arguments are left. Basically, it would sort of be like writing:
>implying addfive isn't >function(y) >add 5 y;
The only difference is that with partial application, the already known parameters would be determined immediately. So it would be more like:
>implying addfive
{
>implying x isn't 5
>implying addfive wasn't >function(y) >add x y
}
But either way, the only downside this would have is it makes some errors harder to catch (eg. you forget a parameter, and get a ton of subsequent errors because you'd be passing around uncomplete functions instead of values)
It still has a few merits though, mostly for the sake of brevity.
I agree that it would be nice to have this, but maybe we should add a special function that returns a reference to the function given as its argument, so we can avoid the extra errors.
Thinking about adding this. Example:
Basically, what would happen when you call a function with less parameters than it requires is that it returns a new function, which takes whichever arguments are left. Basically, it would sort of be like writing:
The only difference is that with partial application, the already known parameters would be determined immediately. So it would be more like:
But either way, the only downside this would have is it makes some errors harder to catch (eg. you forget a parameter, and get a ton of subsequent errors because you'd be passing around uncomplete functions instead of values)
It still has a few merits though, mostly for the sake of brevity.
Do you think it's worth it?