<div dir="ltr">Karl, thanks, but the flag is set to True... And setting it to False doesn't change the output. I'll continue my investigations!<div><br></div><div>JP</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jan 24, 2014 at 6:12 PM, Karl Voelker <span dir="ltr"><<a href="mailto:karl@karlv.net" target="_blank">karl@karlv.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>




<div><div><div class="h5"><div>On Fri, Jan 24, 2014, at 07:38 AM, JP Moresmau wrote:<br></div>
<blockquote type="cite"><div dir="ltr">Hello cafe, I'm continuing my adventures with the GHC API. I'm following the code given at <a href="http://www.haskell.org/haskellwiki/GHC/As_a_library#Running_interactive_statements" target="_blank">http://www.haskell.org/haskellwiki/GHC/As_a_library#Running_interactive_statements</a> to run statements like in GHCi, but the behavior sometimes puzzles me.<div>
 </div>
<div>If I load a simple module:<br></div>
<div> </div>
<div><div>module Test where<br></div>
<div>import qualified Data.Text as T<br></div>
<div> </div>
<div>And then run the statement T.pack \"test\", I expect to see "test" back. But I get Data.Text.Internal.Text _ 0 4. If I run "show $ T.Pack \"test\"" I get the expected result. Text _ 0 4 seems to be the output of the showText debugging function in Data.Text, that I don't see used in the Show instance. And looking at the GHC code (Debugger.hs) it does perform a show of the expression given. Why doesn't it work? What subtlety am I missing?<br>
</div>
</div>
</div>
</blockquote></div></div><div dir="ltr"><div><div> </div>
<div>The example you linked to calls showTerm (<a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/Debugger.html#showTerm" target="_blank">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/Debugger.html#showTerm</a>) which seems to have two different paths depending on the Opt_PrintEvldWithShow dynflag. One path appears to use show, and the other does not.<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">
<div> </div>
<div>-Karl</div>
</font></span></div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br>JP Moresmau<br><a href="http://jpmoresmau.blogspot.com/">http://jpmoresmau.blogspot.com/</a>
</div>