← All traces

Solving a dictionary

describe has a Show a constraint; use calls it at Int. That is the entire program, so every line the solver prints is about one Wanted, and none of it is noise.

What you wrote.

-- The smallest program that makes the solver look up an instance: one
-- constraint from a signature, one dictionary found by search.
module Dict where

describe :: Show a => a -> String
describe x = "value: " ++ show x

use :: String
use = describe (42 :: Int)

What to look for

Typechecker trace → solveWanteds
The work list with one Wanted on it: [W] Show a. This is the pile of facts the typechecker chapter ends with, at its smallest.
Typechecker trace → matchClassInst
The instance lookup itself, and the dictionary it produces as evidence. This is step four of the solver loop: solve outright from a top-level instance.
Typechecker trace → Adding inert dict / Kept inert DictCt
Constraints entering and surviving in the inert set. The paired lines are worth reading closely: [G] $dShow is the Given from the signature, [W] $dShow the Wanted from the call, same class, opposite obligations.