Lambda Calculus → Python → VRED

Interactive Learning Map

1. Function Abstraction (λx.M)

Defines a function

def f(x):\n return x + 1

2. Function Application

Applying function to value

def f(x):\n return x + 1\n\nprint(f(5))

3. Higher-Order Function

Function taking another function

def apply(func, value):\n return func(value)\n\nprint(apply(lambda x: x*2, 5))

4. Closures

Function remembering outer variable

def outer(x):\n def inner():\n return x + 5\n return inner\n\nf = outer(10)\nprint(f())

5. Lambda (Anonymous Function)

Inline function

f = lambda x: x + 1\nprint(f(10))

6. Decorator (Function Transformation)

Modify function behavior

def decorator(func):\n def wrapper():\n return "Hello " + func()\n return wrapper\n\n@decorator\ndef greet():\n return "World"\n\nprint(greet())

7. Recursion

Function calling itself

def fact(n):\n if n == 1:\n return 1\n return n * fact(n-1)\n\nprint(fact(5))