DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

Partial application placeholders #1151

Closed STRd6 closed 5 months ago

STRd6 commented 6 months ago

. placeholder for partial function application.

Works for the common cases but ... is a bit strange so I'll save that for a future iteration.

edemaine commented 5 months ago

Very cool! Looking at the last example, I wonder if f ., . should in fact mean (a, b) => f(a, b) instead of (a) => f(a, a). I could be wrong, but I feel like the multiple arguments is a more common/useful interpretation of a partial. Originally I had thought we could use .0 and .1 (by analogy to $0 and $1) but I realize those already have a meaning (number literal).