A good way to avoid “sharing”?
Suppose that someone would translate this simple Python code to Haskell: def important_astrological_calculation(digits): # Get the first 1000000 digits of Pi! lucky_numbers = calculate_first_digits_of_pi(1000000) return digits in lucky_numbers Haskell version: importantAstrologicalCalculation digits = isInfixOf digits luckyNumbers where luckyNumbers = calculateFirstDigitsOfPi 1000000 After working with the Haskell version, the programmer is astonished to discover that his Haskell version "leaks" memory - after the first time his function is called, luckyNumbers never gets freed. That is