[Haskell-beginners] Re: Applicative Parsec
apfelmus at quantentunnel.de
Sat Nov 7 03:53:07 EST 2009
Matthias Guedemann wrote:
> Hi Brent,
> thanks for the illustrative example.
>> For example, consider parsing a file which contains a positive
>> integer, followed by that many letters. For example,
>> are two instances of this format. In order to parse this, a monadic
>> interface is required, since the result of parsing the number must be
>> used to decide how many things to parse after that.
> I see, but as long as I want to parse context free grammars, it is
Yep. The monadic version can handle context-sensitive grammars.
Incidentally, this is why the Utrecht parsing libraries ( uu-parsinglib
) only offers an applicative interface.
More information about the Beginners