Commit acc2c7ee authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Move versionToInt to Settings/Builders/Haddock

parent fa77d934
......@@ -19,7 +19,7 @@ module Base (
-- * Miscellaneous utilities
minusOrd, intersectOrd, lookupAll, replaceEq, quote, replaceSeparators,
unifyPath, (-/-), versionToInt, matchVersionedFilePath, putColoured
unifyPath, (-/-), matchVersionedFilePath, putColoured
) where
import Control.Applicative
......@@ -74,12 +74,6 @@ replaceWhen p to = map (\from -> if p from then to else from)
quote :: String -> String
quote s = "\"" ++ s ++ "\""
-- | Given a version string such as "2.16.2" produce an integer equivalent.
versionToInt :: String -> Int
versionToInt s = major * 1000 + minor * 10 + patch
where
[major, minor, patch] = map read . words $ replaceEq '.' ' ' s
-- | Normalise a path and convert all path separators to @/@, even on Windows.
unifyPath :: FilePath -> FilePath
unifyPath = toStandard . normaliseEx
......
......@@ -8,6 +8,12 @@ import Predicate
import Settings
import Settings.Builders.Ghc
-- | Given a version string such as "2.16.2" produce an integer equivalent.
versionToInt :: String -> Int
versionToInt s = major * 1000 + minor * 10 + patch
where
[major, minor, patch] = map read . words $ replaceEq '.' ' ' s
haddockBuilderArgs :: Args
haddockBuilderArgs = builder Haddock ? do
output <- getOutput
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment