Data.Version.parseVersion

Einar Karttunen ekarttun at cs.helsinki.fi
Wed Dec 28 18:35:13 EST 2005


Hello

What is the correct way to use Data.Version.parseVersion?
It seems to start with the "wrong" result and the last one
is the intended one. e.g. "1.2.3" is parsed as:

[(Version {versionBranch = [1], versionTags = []},".2.3"),
 (Version {versionBranch = [1,2], versionTags = []},".3"),
 (Version {versionBranch = [1,2,3], versionTags = []},"")]

This is different from the usual read instances. Is the
behaviour intended? Should I just use that as:

filter (null . snd) $ readP_to_S parseVersion "1.2.3" :: [(Version,String)]


- Einar Karttunen


More information about the Libraries mailing list