|
|
|
|
|
by codethief
85 days ago
|
|
> So in `foldr (+) 0 . map (const 1)`, the author gives `f = foldr (+) 0` and `g = map (const 1)` but doesn't supply `x`. That's a partial application. It's not, and the authors doesn't have to. Using your definitions, `f . g` is a function of a single free argument (whether you call it x or y or whatever). Partial application occurs when you want to fix some parameters but not all of them. In the present case, however, there is only one parameter (x) and it's not fixed, so there's no partial application to speak of and one can omit the parameter as usual. Put differently: (.) is a binary operator on functions, and length = f . g from the OP is an equation of functions. You can certainly write it down pointwise, i.e. length(x) = (f . g)(x), but that doesn't tell you anything you didn't know already, and it is unrelated to the case of partial application that the author is discussing. |
|