← All traces

Fusing a pipeline

total xs = sum (map (*2) xs) names two traversals; the compiled code contains one loop and no intermediate list. These two traces are the transformation happening, rule by rule and pass by pass.

What you wrote.

-- The smallest pipeline that fusion collapses: watch the rule firings, then
-- the simplifier iterations that clean up after them.
module Fuse where

total :: [Int] -> Int
total xs = sum (map (* 2) xs)

What to look for

Rule firings
Seven lines, and the story is complete: map rewritten to build form, then fold/build, the fusion rule itself, collapsing producer into consumer.
Simplifier iterations, first vs last
The first listing still mentions list machinery; by the last, the loop runs on unboxed values. The iteration count restarting at 1 marks a new pass; a pass reaching iteration=2 needed a second round to converge.
Simplifier iterations → the final worker
A recursive function over Int# with no cons cells anywhere in it. That is the "no intermediate list" claim from the simplifier chapter, checkable by reading.