I've been using Elm compiler error messages as teaching material in a small study group. Everyone brings code that's wrong on purpose, we read the error together, then fix it.
Record field typos went really well. Write fistName and the compiler compares the fields and points at firstName <-> fistName as a likely typo. People spotted it right away and could say in their own words what went wrong. The compiler will tell you, kindly. It really does.
MISSING PATTERNS was the problem. Add Failed to type Status = Idle | Loading | Failed String without touching the case, and the error names the missing case, with a hint to use Debug.todo as a placeholder if you want to write that branch later. A few people pasted the hint in and stopped there. It compiles, after all. Nobody decided what the screen should show for Failed, and the moment that branch runs, the app crashes.
The hint isn't wrong. It's there to help with a way of working. To someone learning, though, it seems to read as "fix it like this". I might run the same exercise in ReScript next, since adding a case to a variant gets you the same complaint about the unhandled branch. If anyone has taught like this, I'd love to hear how it went.
