Functional Programming
Functional Programming
Functional programming is characterized by the programming with values, functions and functional forms.
Functional programming languages are the result of both abstracting and generalizing the data type of maps.
Recall, the mapping m from each element x of S (called the domain) to the corresponding element m(x) of T
(called the range) is written as:
m : S --> T
For example, the squaring function is a function of type:
sqr : Num --> Num
and may be defined as:
sqr where x |--> x*x
A linear function f of type
f : Num --> Num
may be defined as:
f where x |--> 3*x + 4
The function:
g where x |--> 3*x2 + 4