Watching GHC think
The chapters show the program between stages. These pages show the compiler during them: its own trace output, the working it prints when asked to explain itself, parsed into trees you can fold open.
Each page traces one deliberately tiny module through four instruments:
-ddump-rn-trace, -ddump-tc-trace,
-ddump-simpl-iterations and -ddump-rule-firings. Tiny is the point:
the constraint-solver chapter's advice for reading tc-trace is "start from a
three-line module, never a real one", and these are those modules.
- Solving a dictionary
Dict.hsOne Show constraint from a signature, one instance found by search. The smallest possible run of the constraint solver.
- Fusing a pipeline
Fuse.hssum (map (*2) xs). Watch fold/build fire in the rule log, then the iterations that clean up what it left behind.
- Refining a GADT match
Refine.hsTwo branches, two different Givens. Watch each branch become its own implication constraint, solved under its own assumption.
These flags work on your own code too. The traces here exist because the output is overwhelming precisely when you most need it, on a program you already do not understand, so it is worth first seeing what it says about a program with no mysteries in it.