The documentation of takeAllTreesContent compares it's behaviour to ignoreAllTreesContent, which should consume a single tag and whatever tree of tags/content is inside it. However, takeAllTreesContent in reality just consumes every single event left in the stream. This due to every single case having a recursion calling takeAllTreesContent, for example:
Just e@(EventBeginElement name _) -> do
yield e
takeAllTreesContent
endEvent <- await
case endEvent of
Just e@(EventEndElement name') | name == name' -> yield e >> takeAllTreesContent
_ -> lift $ monadThrow $ InvalidEndElement name endEvent
For it to work as implied by the docs it should clearly terminate after consuming a single tag's tree. Which means removing the above recursion and changing takeAllTreesContent with many takeAllTreesContent.
The documentation of
takeAllTreesContentcompares it's behaviour toignoreAllTreesContent, which should consume a single tag and whatever tree of tags/content is inside it. However,takeAllTreesContentin reality just consumes every single event left in the stream. This due to every single case having a recursion callingtakeAllTreesContent, for example:For it to work as implied by the docs it should clearly terminate after consuming a single tag's tree. Which means removing the above recursion and changing
takeAllTreesContentwithmany takeAllTreesContent.