Etaexpansion
Eta-expansion is a transformation in lambda calculus and functional programming that converts a function value into a new function that takes an argument and applies the original function to that argument. Concretely, if f has type A -> B, eta-expansion yields the function λx:A. f x, so that f and λx. f x are extensionally equivalent under the usual conditions (provided x is not free in f). The opposite transformation is eta-reduction, which removes a lambda when the body is an application of the bound variable to a function.
In languages with currying, eta-expansion makes the parameter structure explicit or adapts functions to higher-order interfaces.
In practice, eta-expansion can influence compiler optimizations and runtime performance. In lazy (non-strict) languages, introducing an
Use cases include adapting a function to a more explicit arity, satisfying particular type signatures or higher-order