I am looking for a satisfy
function like the one Parsec has. Something like:
--The parser satisfy f succeeds for any character for which the supplied
--function f returns True.
--Returns the character that is actually parsed.
satisfy :: (Char -> Bool) -> Parser Char
The only thing I have found is pSatisfy, which requires an Insertion
as argument. I don't understand why this is necessary... I just want the parser to fail in case the predicate is not satisfied!
How can I achieve this?