
12 Apr
2020
12 Apr
'20
3:07 p.m.
On 2020-04-11 4:23 p.m., amindfv@gmail.com wrote:
Say I've got an Attoparsec parser like:
p = string "prio:" *> digit
And some text, e.g.
s = "this is just a prio:5 example, I'd prio:6 very much like to prio:4 parse"
What's the most idiomatic way to apply p to s so that I get out a list ['5', '6', '4']?
I'd go with many (many (notFollowedBy (string "prio:") *> anyChar *> skipWhile (/= 'p') *> string "prio:" *> digit)