Answers
- Beta reduction is the core mechanism of program evaluation in functional programs. It acts on a function application such as
(\ x -> sin x) 1.0
and simplifies it to the body of that functionsin x
, in which it replaces the formal parameterx
with the actual parameter1.0
. - Call by Need is an evaluation strategy. An evaluation strategy decides which functional application to reduce in the current expression. Call by Need only reduces the top-level expression, provided it is a function application. Unlike the commonly used Call by Value strategy, this defers evaluating the function parameters and may eventually not evaluate them at all when this is not needed. At the same time, it employs a sharing mechanism known as thunks to avoid duplicating subexpressions and performing the same reduction repeatedly. In this sense, it is an improvement upon Call by Name.
- Streaming is an approach to data processing whereby a composite data structure (e.g., a list) is not first...