In programming languages, there are two prominent ways to evaluate arguments to a function they are as follows:
- Applicative-order evaluation (AO)
- Normal-order evaluation (NO)
In the case of AO, arguments are evaluated in the calling context, before being passed to the callee. Most conventional programming languages follow this method. In the case of NO, the evaluation of the variables is deferred until the result of the computation is warranted in the context of the callee. Some functional programming languages, such as Haskell, F#, and ML, follow the NO model. In functional programming languages, most of the evaluation of functions is referentially transparent (the invocation of the functions does not produce side-effects); we need to evaluate the expression only once (for a particular value as argument) and the result can be shared, when the evaluation...