I want to read HTML from a String, process it and return the changed document as a String using HXT. As this operation does not require IO, I would rather execute the Arrow with runLA
than with runX
.
The code look like this (omitting the processing for simplicity):
runLA (hread >>> writeDocumentToString [withOutputHTML, withIndent yes]) html
However, the surrounding html
tag is missing in 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 like this:
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 that, and how can I fix it?