Terrific, thanks for the explanation Tillmann! Ranjit. On Monday, March 2, 2015 at 3:46:59 PM UTC-8, Tillmann Rendel wrote: > > Hi, > > Ranjit Jhala wrote: > > To be precise: I get the below error when my code is: > > > > main ::IO () > > main = do tgt <-readFile "dist/PANDOC" > > putStrLn $ "Pandoc TARGET: "++tgt > > txFigHtml > > > > but everything works fine if I remove the first two lines (i.e. just use > > `txFigHtml`) ? > > Your program is run as a filter by pandoc, so everything your program > prints to the the standard output stream (stdout) will get redirected to > pandoc. Including whatever `putStrLn $ "Pandoc TARGET: "++tgt` prints. > Pandoc doesn't know how to understand that information, of course, so > you get a (not really satisfying) error message. > > To print some debugging information to the user, try the standard error > stream (stderr): > > > import System.IO (hPutStrLn, stderr); > > ... > > hPutStrLn stderr $ "Pandoc TARGET: " ++ tgt > > Tillmann > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0b8d1006-92e0-493b-82bd-74c79c8487fd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.