ELI5: Explain Like I'm 5

Η-conversion

Okay kiddo, today we're going to talk about something called η-conversion. It's like turning one thing into another thing that's almost the same, but just a little bit different.

Let's imagine we have a toy car. It has wheels, and it moves when you push it. Now let's imagine that we want to turn this car into a different kind of car that does the exact same thing, but looks slightly different. We could just take the wheels off the original toy car, and put them on a different body with a different design. Now we have a new car that still moves when you push it, but looks different.

In programming, we use something called functions. These are like little machines that take in input, do something with it, and then give you output. For example, if we have a function called "add", we can give it two numbers, and it will give us the sum of those two numbers.

Now let's imagine that we have two functions that are almost the same but have different names. One is called "addOne" and the other is called "increment". They both take in a number and give you back that number plus one.

But we might want to just have one function that does the same thing as both "addOne" and "increment". This is where η-conversion comes in. We can convert the "addOne" and "increment" functions into a new function that's almost the same, but has a slightly different name.

To do this, we'll take the "addOne" function and remove the input variable. You might be asking, "but how does it know what number to add one to?" Well, that's the magic of η-conversion. It automatically knows to use the number that's going to be passed in as an input. So now we have a new function that's almost the same as "addOne", but is called something different, like "plusOne".

We can do the same thing with "increment". We'll remove the input variable and now we have a new function called "plusOne" that does the exact same thing as the "plusOne" function we got from converting "addOne".

Now we don't need both "addOne" and "increment". We can just use the new "plusOne" function for both. It's like having a new toy car that looks different but does the same thing as the old toy car. And that's η-conversion!