Evaluation Order
- From left to right.
- Function arguments evals by value by default.
- You can change this by insert
=>
before type annotation in function defination. For example:
Function Type
Curing
Expansion of Multiple Parameter List
In general, a definition of a function with multiple parameter lists
where n > 1, is equivalent to
where is a fresh identifier. Or for short:
More Function Types
The type of function bellow is(Int => Int) => (Int, Int) => Int
. Note that function types are right associate. So the above type is equivalent to (Int => Int) => ((Int, Int) => Int)