Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
acc2c7ee
Commit
acc2c7ee
authored
May 17, 2016
by
Andrey Mokhov
Browse files
Move versionToInt to Settings/Builders/Haddock
parent
fa77d934
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Base.hs
View file @
acc2c7ee
...
...
@@ -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
...
...
src/Settings/Builders/Haddock.hs
View file @
acc2c7ee
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment