Function Definition
Let be an expression that uses (suppose we have here) Assume we have and ( has type and has type )
Normally
(we define to be )
Then is judgmentally equal to
λ-abstraction
If we do not want to introduce a name for the function, we can write
Thus we have: (This anonymous function has type ) In this specific example (both type are ) we have
Another notation is:
NOTE
This is the concept of anonymous function in Haskell
Apply Function
In the example above
Dummy variables
Let’s define What is ? it is (note that would be wrong), because the inside is a “local variable”
Currying
For a function that has two inputs:
Suppose it has type Currying allows us to write it as
This means we allow to be written as
Using abstraction this corresponds to or even written as ()
Example
Let be , then we would have