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
c1b296ab
Commit
c1b296ab
authored
Aug 06, 2015
by
Andrey Mokhov
Browse files
Move decodeModule to Util.hs.
parent
c02e070c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Settings/Util.hs
View file @
c1b296ab
...
...
@@ -89,11 +89,6 @@ getHsSources = do
return
$
foundSources
++
generatedSources
-- Given a module name extract the directory and file names, e.g.:
-- decodeModule "Data.Functor.Identity" = ("Data/Functor/", "Identity")
decodeModule
::
String
->
(
FilePath
,
String
)
decodeModule
=
splitFileName
.
replaceEq
'.'
'/'
-- findModuleFiles scans a list of given directories and finds files matching a
-- given extension pattern (e.g., "*hs") that correspond to modules of the
-- currently built package. Missing module files are returned in a separate
...
...
src/Util.hs
View file @
c1b296ab
module
Util
(
module
Data
.
Char
,
module
System
.
Console
.
ANSI
,
replaceIf
,
replaceEq
,
replaceSeparators
,
replaceIf
,
replaceEq
,
replaceSeparators
,
decodeModule
,
unifyPath
,
(
-/-
),
chunksOfSize
,
putColoured
,
putOracle
,
putBuild
,
putError
,
...
...
@@ -22,6 +22,11 @@ replaceEq from = replaceIf (== from)
replaceSeparators
::
Char
->
String
->
String
replaceSeparators
=
replaceIf
isPathSeparator
-- Given a module name extract the directory and file names, e.g.:
-- decodeModule "Data.Functor.Identity" = ("Data/Functor/", "Identity")
decodeModule
::
String
->
(
FilePath
,
String
)
decodeModule
=
splitFileName
.
replaceEq
'.'
'/'
-- Normalise a path and convert all path separators to /, even on Windows.
unifyPath
::
FilePath
->
FilePath
unifyPath
=
toStandard
.
normaliseEx
...
...
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