
15 Oct
2008
15 Oct
'08
3:20 p.m.
On Wed, 2008-10-15 at 20:22 +0100, Andrew Coppin wrote:
I like Parsec. I use it for everything. But it does have one irritating problem.
Consider the following parser:
expressions = many1 expression
Suppose this is the top-level parser for my language.
I always wrap my top-level parsers in return const `ap` parser `ap` eof to express that they have to match the entire input. (This is a bit easier if you supply the missing Applicative instance: const <$> parser <*> eof ). I think Parsec should either do this itself or tell you what the un-consumed input tokens were, but it doesn't. jcc