Where sharing begins and ends

A pure program evaluates the following expression using lazy evaluation with sharing. The function costly terminates and returns a number. Producing the final result requires every operand of the additions.


haskell
let left = costly 8
    right = costly 8
in left + left + right


Assume no compiler transformation merges separate expressions. Which statements correctly describe this evaluation? Select all that apply.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Lazy Evaluation Questions: