<div dir="ltr">Using {-# LANGUAGE TemplateHaskell #-} you can use 'foo and ''Foo to get access to the names in scope in the module that is building the splice, rather than worrying about what names are in scope in the module the code gets spliced into.<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 16, 2015 at 10:54 PM, J. Garrett Morris <span dir="ltr"><<a href="mailto:Garrett.Morris@ed.ac.uk" target="_blank">Garrett.Morris@ed.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to write some Template Haskell code that (among other<br>
things) manipulates IntSets.  So, for example, I'd like a splice to<br>
generate a call to Data.IntSet.fromList.  However, I'm not sure how<br>
IntSet will be imported in the target module.  Is there a way to<br>
resolve the fully qualified name (or similar) to a TH Name, without<br>
having to know how it's imported in the splicing module?  (The obvious<br>
approach---mkName "Data.IntSet.fromList"---seems not to work in GHC<br>
7.8.)<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
 /g<br>
<br>
--<br>
The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users</a><br>
</font></span></blockquote></div><br></div>