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
{{ message }}
Repository navigation
Ch3 - Improve content on curried functions and partial application #261
changed the title [-]Improve content on curried functions and partial application[/-][+]Ch3 - Improve content on curried functions and partial application[/+]on Jan 2, 2021
A sequence like this could be a simpler way to introduce curried functions, partial application, and infix operators:
add5 x = 5 + x
add5 x = add 5 x
add5 x = (+) 5 x
add5 x = 5`add` x
add5 = add 5
I assume the book chose flip and apply as examples because their signatures contain only type variables and no constraints (similar to const, on, compose, etc.), but I'd like to convert to more beginner-friendly alternatives. That change would resolve #260.
We could even move some of the content from these sections (e.g. Curried Functions and Infix Function Application) to the reference docs (proposed in #282 (comment)). But we'd still want to add exercises (#252) for that material, even if we're just linking to the docs for explanation.
The existing section is not super accessible to FP beginners.
I think we should start with a gentler introduction, maybe stuff like:
add5 = add 5