12.1. Functional Programming Paradigm - Concise
12.1. Functional Programming Paradigm - Concise
www.pmt.education
Specification:
www.pmt.education
4.12.1.3 Function application
Know that function application means a function applied to its
arguments.
The process of giving particular inputs to a function is called function
application, for example add(3,4) represents the application of the function
add to integer arguments 3 and 4. The type of the function is f: integer x
integer → integer where integer x integer is the Cartesian product of the set
integer with itself. Although we would say that function f takes two
arguments, in fact it takes only one argument, which is a pair, for example
(3,4).
www.pmt.education
Functions
● Rules that, for each element in some set A of inputs, assigns an output chosen
from set B
● Does not necessarily use every member of B
● An argument is a piece of data passed to a function
● Functions are said to be applied to their arguments, creating the return value
● An argument could be a number (0, 1, 3.4, -8 e.t.c), a character (“a”, “D”, “!” e.t.c)
or any other data type
● Functions will specify what data type is required for their arguments
Function Types
First-class objects
www.pmt.education
Function application
Composition of functions
www.pmt.education