Skip to content

reify does not work on data structures defined in files without Language pragma of Template Haskell and without -fth or -XTemplateHaskell command line flags

reify does not work on data structures defined in files compiled without TemplateHaskell.

  • Main.hs: File with the splice expression
  • Fields.hs: File with the Template Haskell code that lists all the fields in particular datastructures recursively.
  • DataStructure.hs: File with the datastructure being reified in TH.hs

When all the files have the TemplateHaskell Language pragma, everything works. When the command line flag -fth or -XTemplateHaskell are used, everything works. When the DataStructure.hs does not have the TemplateHaskell Language pragma, then when the data-structure is being reified in TH.hs, it generates blank lists for all the fields of TyConI (DataD ...

Edited by Simon Marlow
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information