http://homepages.inf.ed.ac.uk/wadler/topics/call-by-need.html
How call-by-need fits into the picture...
Evaluation Strategies (Wikipedia)
- 1 Strict evaluation
- 2 Non-strict evaluation
- 2.1 Normal order
- 2.2 Call by name
- the arguments to a function are not evaluated before the function is called — rather, they are substituted directly into the function body (using capture-avoiding substitution) and then left to be evaluated whenever they appear in the function
- 2.3 Call by need
- a memoized version of call-by-name
- Haskell is the most well-known language that uses call-by-need evaluation. R also uses a form of call-by-need. .NET languages can simulate call-by-need using the type
Lazy<T>
. - 2.4 Call by macro expansion
- 3 Nondeterministic strategies
No comments:
Post a Comment