[Haskell-cafe] Re: Parsec bug, or...?

Christian Maeder Christian.Maeder at dfki.de
Wed Oct 14 10:09:39 EDT 2009


My fix would be to parse as many letters as possible "many1 alpha"
(that's longest match) and then check the result with "isPrefixOf" for
all your alternatives (and return the alternative that matches first).

Cheers Christian

Martijn van Steenbergen wrote:
> Brandon S. Allbery KF8NH wrote:
>> My fix would be to have myPrefixOf require the prefix be terminated in
>> whatever way is appropriate (end of input, white space, operator?)
>> instead of simply accepting as soon as it gets a prefix match
>> regardless of what follows.
> 
> Maybe you can use notFollowedBy for this.
> 
> HTH,
> 
> Martijn.


More information about the Haskell-Cafe mailing list