Functional Programming has been around for quite a while and concepts from it are making their way into more mainstream languages. Partial function application is one example that can be very handy to have in your toolbox.
A big advantage of using partial application is allowing us to take general functions and specialize them at runtime.
Instead of writing special purpose functions, we can reuse general functions. This allows us to have less code, especially if the functions are complicated. It helps our code to be simpler, since using situation specific functions (with fewer arguments and more specific names) makes our code less cluttered and more readable.
Finally, reusing general purpose functions and specializing them by partial application doesn't add new logic which could have bugs.
Page last edited March 08, 2024
Text editor powered by tinymce.