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

Uwe Hollerbach uhollerbach at gmail.com
Tue Oct 13 11:10:08 EDT 2009


On 10/12/09, Martijn van Steenbergen <martijn at van.steenbergen.nl> 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.
>
>

Yes, I've looked at that and am thinking about it. I'm not quite
certain it's needed in my real program... I seem to have convinced
myself that if I actually specify a proper set of unique prefixes, ie,
set the required lengths for both "frito" and "fromage" to 3 in the
test program, I won't get into this situation. Assuming I haven't
committed another brain-fart there, that would be sufficient;
presumably, in a real program one would want to actually specify the
unique prefix, rather than a non-unique pre-prefix. It seems to work
fine in my real program, anyway.

Uwe


More information about the Haskell-Cafe mailing list