Questions tagged [call-by-need]
5 questions
24
votes
1 answer
Haskell: How "cache" friendly is Lazy Eval / call by need
I have been studying Haskell in my spare time for a couple of months now. I'm wondering how Haskell performs on the current stock hardware, in regards to the memory sub-system (L1, L2, L3 cache). Can someone please point me to any report/study on…

user3169543
- 1,499
- 1
- 10
- 16
21
votes
4 answers
What is call-by-need?
I want to know what is call-by-need.
Though I searched in wikipedia and found it here: http://en.wikipedia.org/wiki/Evaluation_strategy,
but could not understand properly.
If anyone can explain with an example and point out the difference with…

Barshan Das
- 3,677
- 4
- 32
- 46
5
votes
2 answers
Simple example of call-by-need
I'm trying to understand the theorem behind "call-by-need." I do understand the definition, but I'm a bit confused. I would like to see a simple example which shows how call-by-need works.
After reading some previous threads, I found out that…

vesii
- 2,760
- 4
- 25
- 71
1
vote
1 answer
Call By Need in Scheme
I have this code knowing that parameters are passed using call by need:
(define fact-2
(let ((foo (lambda (n f)
(if (zero? n)
1
(f n f)))))
(lambda (n)
(let ((res 1))
(foo n…

Maya Saias
- 37
- 9
1
vote
1 answer
Call-by-need and call-by-name reduction relation semantics
While trying to summarize my knowledge about lambda calculus, I understood that I'm quite familiar with call-by-value but I've never seen сall-by-need reduction semantics. I know the definition, but it would be great to see precise meaning.
This is…

vonaka
- 913
- 1
- 11
- 23