-- of GHC. In which case, we might need to pick up ReadP from
-- Distribution.Compat.ReadP, because the version in
-- Text.ParserCombinators.ReadP doesn't have all the combinators we need.
-- of GHC. In which case, we might need to pick up ReadP from
-- Distribution.Compat.ReadP, because the version in
-- Text.ParserCombinators.ReadP doesn't have all the combinators we need.
import Control.Monad ( liftM )
import Data.Char ( isDigit, isAlphaNum )
import Control.Monad ( liftM )
import Data.Char ( isDigit, isAlphaNum )
etc.). This is expected to be sufficient for many uses, but note that
you may need to use a more specific ordering for your versioning
scheme. For example, some versioning schemes may include pre-releases
etc.). This is expected to be sufficient for many uses, but note that
you may need to use a more specific ordering for your versioning
scheme. For example, some versioning schemes may include pre-releases
-which have tags @"pre1"@, @"pre2"@, and so on, and these would need to
+which have tags @\"pre1\"@, @\"pre2\"@, and so on, and these would need to
be taken into account when determining ordering. In some cases, date
ordering may be more appropriate, so the application would have to
look for @date@ tags in the 'versionTags' field and compare those.
be taken into account when determining ordering. In some cases, date
ordering may be more appropriate, so the application would have to
look for @date@ tags in the 'versionTags' field and compare those.
-- | Provides one possible concrete representation for 'Version'. For
-- a version with 'versionBranch' @= [1,2,3]@ and 'versionTags'
-- | Provides one possible concrete representation for 'Version'. For
-- a version with 'versionBranch' @= [1,2,3]@ and 'versionTags'
#endif
parseVersion = do branch <- sepBy1 (liftM read $ munch1 isDigit) (char '.')
tags <- many (char '-' >> munch1 isAlphaNum)
#endif
parseVersion = do branch <- sepBy1 (liftM read $ munch1 isDigit) (char '.')
tags <- many (char '-' >> munch1 isAlphaNum)