Meanwhile the behaviour changed and the -ddump-to-file
flag in addition to the -ddump-splices
flag causes the splices to be written to a file, see Section 9.26 of the current (GHC 8.2.1) documentation for more details.
On older versions of GHC (I didn't check in which version exactly the behaviour changed), -ddump-splices
worked differently:
The -ddump-splices
option causes GHC to dump the splices to stderr. Unfortunately, the -ddump-to-file
flag doesn't affect splices (I don't know whether that has deeper reasons or is just an oversight), so you need to capture the stderr output to save the splices for later investigation,
ghc -XTemplateHaskell -ddump-splices Page.hs 2> Page.dump-splices
on sufficiently bash-like shells.