Add 'skipMany' to skip values without needing to build an intermediat…#94
Add 'skipMany' to skip values without needing to build an intermediat…#94k0ral merged 2 commits intosnoyberg:masterfrom
Conversation
xml-conduit/Text/XML/Stream/Parse.hs
Outdated
| skipMany :: MonadThrow m | ||
| => Consumer Event m (Maybe a) | ||
| -> Consumer Event m () | ||
| skipMany consumer = manyIgnoreYield (return Nothing) ((() <$) <$> consumer) |
There was a problem hiding this comment.
Yes, I think I initially tried () <$ which doesn't map inside the Maybe and didn't think of using void when changing is, I've changed that now.
|
How does |
|
|
|
Actually, |
|
Merged and renamed into |
I often find myself needing to skip over many tags while scraping messy data. Having a convenient combinator for this is nicer than repeated use of 'manyIgnoreYield (return Nothing)', although not absolutely crucial.