string s parses a sequence of characters that identically
match
s. Returns the parsed string (i.e.
s). This
parser consumes no input if it fails (even if a partial match).
Note: The behaviour of this parser is different to that of the
similarly-named parser in Parsec, as this one is all-or-nothing. To
illustrate the difference, the following parser will fail under Parsec
given an input of
"for":
string "foo" <|> string "for"
The reason for its failure is that the first branch is a partial
match, and will consume the letters
'f' and
'o'
before failing. In attoparsec, the above parser will
succeed on
that input, because the failed first branch will consume nothing.