Haskell "Source reduction"
- by Martin
I'm revising for an upcoming Haskell exam and I don't understand one of the questions on a past paper. Google turns up nothing useful
fst(x, y) = x
square i = i * i
i) Source reduce, using Haskells lazy evaluation, the expression:
fst(square(3+4), square 8)
ii) Source reduce, using strict evaluation, the same expression
iii) State one advantage of lazy evaluation and one advantage of strict evaluation