Help needed with Data.Version

Ross Paterson ross at soi.city.ac.uk
Wed Mar 23 10:16:09 EST 2005


On Wed, Mar 23, 2005 at 02:55:47PM +0000, Krasimir Angelov wrote:
> I have found a bug in Data.Version. The expression:
> 
> readP_to_S parseVersion "1.0" 
> 
> produces:
> 
> [(Version {versionBranch = [1], versionTags = []},".0"),(Version
> {versionBranch= [1,0], versionTags = []},"")]
> 
> With other words the parser is ambiguous.

It's no more ambiguous than

readP_to_S (many1 (satisfy isDigit)) "1234"
[("1","234"),("12","34"),("123","4"),("1234","")]

It just needs to be used in context.


More information about the Libraries mailing list