Hi,
In ghci, if you change a module that exports a TH template it will not recompile modules that use the template. Example:
-- In A.hs
{-#LANGUAGE TemplateHaskell#-}
module A where
import Language.Haskell.TH
a = [d|x = 5|]
-- in B.hs
{-#LANGUAGE TemplateHaskell#-}
import A
a
-- As expected in ghci B.hs:
*Main> x
5
-- But if i change the def. of a to [d|x = 4|] and do :r
[1 of 2] Compiling A ( A.hs, interpreted )
Ok, modules loaded: A, Main.
*Main> x
5
The only workaround i know is to reload all modules. I assume you have the same problem when compiling with ghc. This has caused headaches for me on several occasions lately, is there a ticket for it or should i submit one?
Regards,
Jonas