JP Moresmau | 24 Jan 16:38 2014
Picon

Why is the Show instance of Text not used by showTerm?

Hello cafe, I'm continuing my adventures with the GHC API. I'm following the code given at http://www.haskell.org/haskellwiki/GHC/As_a_library#Running_interactive_statements to run statements like in GHCi, but the behavior sometimes puzzles me.

If I load a simple module:

module Test where
import qualified Data.Text as T

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?

Thanks!

JP

--
JP Moresmau
http://jpmoresmau.blogspot.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane