I am writing a little TemplateHaskell to overlay QuickCheck style specifications together. I require that each module containing properties export a symbol called axiom_set. Then my checkAxioms function finds all the "axiom_set" characters from the imported modules, where I call checkAxioms.
checkAxioms :: DecsQ
checkAxioms = do
ModuleInfo ms <- reifyModule =<< thisModule
forM_ ms $ \mi@(Module _ m) -> do
runIO . print =<< lookupValueName (modString m ++ ".axiom_set")
The above code should find all the imported axiom_set characters. However, if Module.Axioms defines axiom_set, but I imported it as follows
import Module.Axioms as MA
my code cannot find MA.axiom_set. Any tips?
source
share