Yesod's Haskell pattern code is used only to generate code. In this sense, this is a strict replacement for the template. Instead of using the Haskell template, we could manually write the conversion from the syntax of the route file to the code that you must write manually, and you could write the equivalent code yourself.
With introspection, you actually look at the existing information that the compiler has and makes decisions. For example, you can find all instances of the Show class and create a String with this list. This approach may be useful in some cases, for example, to automatically create a test suite. A commentary in the book states that Yesod never does this.
source share