snoyberg/xml — pull request #40 by ulikoehler (2014-08-01 02:15:46+00:00)
Title: Add functions to ignore subtrees & result-streaming (yield) parsers

This is basically a draft that adds three sets of functions:

1. Result-streaming functions (i.e. your `yieldWhileJust` from [this SO issue](http://stackoverflow.com/q/21367423/2597135))
2. Functions to ignore empty tags (i.e. no children)
3. Functions to ignore tags that are not neccessarily empty (i.e. subtrees), solves [this SO issue](http://stackoverflow.com/q/24336541/2597135))

For most projects I've been using HXT, mostly because of the lack of these functions (especially 2) and 3): You had to parse absolutely everything or nothing would work).

Just as for `tag` and related functions, more flexible functions (using predicates) and easier-to-use functions (using a single `Name`) have been added.

From the library user's standpoint, this pull request mainly provides the new function `many'` that ignores anything (i.e. content, attributes and entire subtrees) if the consumer does not match.
Therefore it is now possible to parse this XML document:
```xml

Michael

abc

Eliezer

```
by only replacing `many` with `many'` in `parsePeople = tagNoAttr "people" $ many parsePerson` in the example. Additionally, a result-streaming counterpart `manyYield'` exists.

I think the implementation is somewhat incomplete and could probably be improved significantly but I'd like to hear your opinion on it.

Please feel free not to merge if this doesn't fit your needs or you'd like something to be done differently (hints will be appreciated)! I might also be unaware of some characteristics of the new functions.