Haskell/Functions

Functions in Haskell are one of its fundamental constructs. Some familiar functions like addition or multiplication are binary, taking two arguments and returning a single value. Formally, functions are binary relations between two sets, such that each member of the first set maps exactly to one member of the second set. 1 + 1 will always return 2, at least in decimal.

In Haskell, functions are largely defined not only by their definitions,

but also by their declarations, which contain the types of their inputs and outputs.

bounds x to the set of Integers, which maps directly to the set of Integers. (1 == 1, after all)

Functions can be thought of abstractly as black boxes, which take input and return output. This is the basis for the lambda calculus, another heavy influencer of Haskell.