The technique you're referring to is "currying" or "partial application", but the funny name you're hinting at might be "eta conversion" or a playful term like "lambda lifting". However, the most likely answer is "currying", even though it's not inherently funny. Let me clarify:
Key Concepts:
-
Currying:
-
Partial Application:
-
Eta Conversion:
- A concept in lambda calculus where a function
f is converted to λx. f x, effectively "lifting" it. While not funny, it’s a technical term.
-
Lambda Expressions:
Why the "Funny Name"?
If the name is "eta conversion", it’s derived from the Greek letter η (eta), which is a play on words in lambda calculus. Alternatively, "currying" is named after mathematician Haskell Curry, but it’s not inherently humorous.
Practical Example in C#:
// Currying example
Func<int, Func<int, int>> Add = x => y => x + y;
var add5 = Add(5); // Partially applied function
int result = add5(3); // 8
In Scala:
def add(x: Int)(y: Int): Int = x + y
val add5 = add(5) _ // Partially applied
val result = add5(3) // 8
If the term you’re thinking of is "eta conversion", it’s a technical term rooted in lambda calculus. Otherwise, currying or partial application are the core concepts. Let me know if you meant something else! 😊