From 092f9b380fc98f9545122652e163ad5741b1ee5b Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 6 Jul 2009 23:11:41 +0000 Subject: Remove unused functions from Haddock.Utils --- src/Haddock/Utils.hs | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index 439ed672..5545be2e 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -19,7 +19,6 @@ module Haddock.Utils ( toDescription, toInstalledDescription, -- * Filename utilities - basename, dirname, splitFilename3, moduleHtmlFile, nameHtmlRef, contentsHtmlFile, indexHtmlFile, frameIndexHtmlFile, @@ -76,6 +75,7 @@ import System.Environment ( getProgName ) import System.Exit ( exitWith, ExitCode(..) ) import System.IO ( hPutStr, stderr ) import System.IO.Unsafe ( unsafePerformIO ) +import System.FilePath import Distribution.Verbosity import Distribution.ReadE @@ -169,48 +169,6 @@ restrictATs names ats = [ at | at <- ats , tcdName (unL at) `elem` names ] -- ----------------------------------------------------------------------------- -- Filename mangling functions stolen from s main/DriverUtil.lhs. -type Suffix = String - -splitFilename :: String -> (String,Suffix) -splitFilename f = split_longest_prefix f (=='.') - -basename :: String -> String -basename f = base where (_dir, base, _suff) = splitFilename3 f - -dirname :: String -> String -dirname f = dir where (dir, _base, _suff) = splitFilename3 f - --- "foo/bar/xyzzy.ext" -> ("foo/bar", "xyzzy", ".ext") -splitFilename3 :: String -> (String,String,Suffix) -splitFilename3 str - = let (dir, rest) = split_longest_prefix str isPathSeparator - (name, ext) = splitFilename rest - real_dir | null dir = "." - | otherwise = dir - in (real_dir, name, ext) - -split_longest_prefix :: String -> (Char -> Bool) -> (String,String) -split_longest_prefix s pred0 - = case pre0 of - [] -> ([], reverse suf) - (_:pre) -> (reverse pre, reverse suf) - where (suf,pre0) = break pred0 (reverse s) - -pathSeparator :: Char -#ifdef __WIN32__ -pathSeparator = '\\' -#else -pathSeparator = '/' -#endif - -isPathSeparator :: Char -> Bool -isPathSeparator ch = -#ifdef mingw32_TARGET_OS - ch == '/' || ch == '\\' -#else - ch == '/' -#endif - moduleHtmlFile :: Module -> FilePath moduleHtmlFile mdl = case Map.lookup mdl html_xrefs of -- cgit v1.2.3