[commit: ghc] wip/nfs-locking: Move versionToInt to Settings/Builders/Haddock (acc2c7e)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:14:28 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/acc2c7eef93e5372ce355de6c49cc24f9c507dab/ghc

>---------------------------------------------------------------

commit acc2c7eef93e5372ce355de6c49cc24f9c507dab
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue May 17 23:41:55 2016 +0100

    Move versionToInt to Settings/Builders/Haddock


>---------------------------------------------------------------

acc2c7eef93e5372ce355de6c49cc24f9c507dab
 src/Base.hs                      | 8 +-------
 src/Settings/Builders/Haddock.hs | 6 ++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index 328eb98..8f02865 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -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
diff --git a/src/Settings/Builders/Haddock.hs b/src/Settings/Builders/Haddock.hs
index 37964b4..4c0b6f7 100644
--- a/src/Settings/Builders/Haddock.hs
+++ b/src/Settings/Builders/Haddock.hs
@@ -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



More information about the ghc-commits mailing list