O Que É Partial Application?
Partial application é fornecer a uma função alguns, mas não todos, os seus argumentos para receber de volta uma nova função que espera o restante. Os argumentos fornecidos são capturados, e a função resultante é chamada depois com os restantes. Ela especializa uma função geral em uma mais específica sem reescrevê-la.
Por que importa
A partial application permite pré-configurar comportamento e passar adiante a função especializada resultante, reduzindo a passagem repetitiva de argumentos. Ela combina naturalmente com currying e higher-order functions.
Guias relacionados
What Is Currying?Currying transforms a function of several arguments into a chain of functions each taking one argument and re…
What Is a Higher-Order Function?A higher-order function takes other functions as arguments or returns a function as its result, treating beha…
What Is Closure Conversion?Closure conversion is a compiler transformation that turns nested functions capturing variables into plain fu…