[commit: ghc] wip/nfs-locking: Move decodeModule to Util.hs. (c1b296a)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:16:21 UTC 2017


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

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

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

commit c1b296ab5dd0d4795ad2c4e86f5a00b2ffa947b7
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Aug 6 01:38:54 2015 +0100

    Move decodeModule to Util.hs.


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

c1b296ab5dd0d4795ad2c4e86f5a00b2ffa947b7
 src/Settings/Util.hs | 5 -----
 src/Util.hs          | 7 ++++++-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Settings/Util.hs b/src/Settings/Util.hs
index c688b5d..13e5be0 100644
--- a/src/Settings/Util.hs
+++ b/src/Settings/Util.hs
@@ -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
diff --git a/src/Util.hs b/src/Util.hs
index f00785f..1c34a87 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -1,7 +1,7 @@
 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



More information about the ghc-commits mailing list