(I'm sure this must have been answered on this site already, but search gets inundated with the concept of calling free() on a variable in C.)
I came across the term "eta reduction," which was defined something like f x = M x ==> M
if x is "not free in M". I mean, I think I understand the gist of what it's trying to say, it seems like what you do when you convert a function to point-free style, but I don't know what the qualifier about x not being free means.
In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that function. The term non-local variable is often a synonym in this context.
When you first started learning about variables, most of them are free variables. For example, the x in this function is a free variable: f(x) = 3x - 1.
basic variable: any variable that corresponds to a pivot column in the augmented matrix of a system. ● free variable: all nonbasic variables. EXAMPLE: 160 300.
Here's an example:
\f -> f x
In this lambda, x
is a free variable. Basically a free variable is a variable used in a lambda that is not one of the lambda's arguments (or a let
variable). It comes from outside the context of the lambda.
Eta reduction means we can change:
(\x -> g x) to (g)
But only if x
is not free (i.e. it is not used or is an argument) in g
. Otherwise we'd be creating an expression which refers to a unknown variable:
(\x -> (x+) x) to (x+) ???
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With