I wrote a short tutorial on using the GHC flag
-ddump-splices to look at the Haskell code generated from quasiquotes and Template Haskell. It is using the heterocephalus library as an example.
You can find the tutorial here.
You should read the tutorial for more information, but the main takeaway is that GHC/stack can be run like the following to produce the splice files:
.dump-splices files somewhere under
find can be used to figure out the specific path of the files:
$ find .stack-work/ -name '*.dump-splices' .stack-work/dist/x86_64-linux/Cabal-18.104.22.168/build/heterocephalus-example/heterocephalus-example-tmp/app/Example.dump-splices
If you are using a multi-project setup with
*.dump-splices files will actually be created in the
.stack-work/ directory inside the sub-project itself, NOT the main top-level
.stack-work/. You may need to change the
find command above to look something like this:
$ find . -name '*.dump-splices' some-subpackage/.stack-work/dist/x86_64-linux/Cabal-22.214.171.124/build/some-subpackage/some-subpackage/tmp/app/SubPack.dump-splices