getChompedString

Sometimes parsers like int or variable cannot do exactly what you need. The "chomping" family of functions is meant for that case! page

getChompedString : Parser a -> Parser String

Maybe you need to parse valid PHP variables like $x and $txt:

php : Parser String php = getChompedString <| succeed () |. chompIf (\c -> c == '$') |. chompIf (\c -> Char.isAlpha c || c == '_') |. chompWhile (\c -> Char.isAlphaNum c || c == '_')

The idea is that you create a bunch of chompers that validate the underlying characters. Then getChompedString extracts the underlying String efficiently.