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

Move decodeModule to Util.hs.

parent c02e070c
......@@ -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
......
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
......
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