Stage Fright Peeled Away: Writing the ‘peel’ Function with Template Haskell

I was recently updating a work project’s user guide, and added a page that involves Template Haskell (TH). A reviewer noted that TH can be challenging to grasp and suggested adding pointers to learning resources. I’ve always found the trickiest part of TH to be the stage errors, which often confuse even experienced Haskell developers. I couldn’t find an existing TH tutorial that covers stage…