I&#39;m trying to load my interpreter in the Q monad:<br><span style="font-family:courier new,monospace"><br>cr :: QuasiQuoter<br>cr = QuasiQuoter { quoteExp = quoteRuleFunc}<br><br>quoteRuleFunc :: String -&gt; Q TH.Exp<br>
quoteRuleFunc s = do<br>   res &lt;- runIO $ runInterpreter $ do<br>      setImports [&quot;Prelude&quot;, &quot;Language.Nomyx.Rule&quot;, &quot;Language.Nomyx.Expression&quot;, &quot;Language.Nomyx.Test&quot;,<br>               &quot;Language.Nomyx.Examples&quot;, &quot;GHC.Base&quot;, &quot;Data.Maybe&quot;]<br>
      interpret s (as :: RuleFunc)<br>   case res of<br>      Right _ -&gt; [| s |]<br>      Left e -&gt; fail $ show e</span><br><br><br> However, I always obtain an error durring compilation:<br><br><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">...<br>
</span>Loading package XXX ... linking ... done.<br><br><br>GHCi runtime linker: fatal error: I found a duplicate definition for symbol<br>   __stginit_ghczm7zi4zi1_DsMeta<br>whilst processing object file<br>   /usr/lib/ghc/ghc-7.4.1/libHSghc-7.4.1.a<br>
This could be caused by:<br>   * Loading two different object files which export the same symbol<br>   * Specifying the same object file twice on the GHCi command line<br>   * An incorrect `package.conf&#39; entry, causing some object to be<br>
     loaded twice.<br>GHCi cannot safely continue in this situation.  Exiting now.  Sorry.<br><br></span><br>I vaguely understand that the interpreted modules are conflicting with the compiled ones...<br><br><br><div class="gmail_quote">
On Fri, Feb 22, 2013 at 11:51 PM, Corentin Dupont <span dir="ltr">&lt;<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Great! That seems very powerful. So you can do what you want during compilation, readin files, send data over the network?<br>Other question, in my example how can I halt the compilation if a test program is wrong?<div class="HOEnZb">
<div class="h5"><br><br>
<div class="gmail_quote">On Fri, Feb 22, 2013 at 8:30 PM, Francesco Mazzoli <span dir="ltr">&lt;<a href="mailto:f@mazzo.li" target="_blank">f@mazzo.li</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

At Fri, 22 Feb 2013 19:43:51 +0100,<br>
<div>Corentin Dupont wrote:<br>
&gt; Hi Adam,<br>
&gt; that looks interresting. I&#39;m totally new to TH and QuasiQuotes, though.<br>
&gt; Can I run IO in a QuasiQuoter? I can run my own interpreter.<br>
<br>
</div>Yes, you can:<br>
&lt;<a href="http://hackage.haskell.org/packages/archive/template-haskell/2.8.0.0/doc/html/Language-Haskell-TH.html#v:runIO" target="_blank">http://hackage.haskell.org/packages/archive/template-haskell/2.8.0.0/doc/html/Language-Haskell-TH.html#v:runIO</a>&gt;.<br>


<span><font color="#888888"><br>
Francesco<br>
</font></span></blockquote></div><br>
</div></div></blockquote></div><br>