I want to read HTML from String, process it, and return the modified document as a string using HXT. Since this operation does not require I / O, I would rather runLA arrow with runLA than with runX .
The code looks like this (excluding processing for simplicity):
runLA (hread >>> writeDocumentToString [withOutputHTML, withIndent yes]) html
However, the html tag is missing the result:
["\n <head>\n <title>Bogus</title>\n </head>\n <body>\n Some trivial bogus text.\n </body>\n",""]
When I use runX instead:
runX (readString [] html >>> writeDocumentToString [withOutputHTML, withIndent yes])
I get the expected result:
["<html>\n <head>\n <title>Bogus</title>\n </head>\n <body>\n Some trivial bogus text.\n </body>\n</html>\n"]
Why is this and how can I fix it?
source share