From 99b3a6a3a48e8c29b5dcc55b152bd8e3db1ec384 Mon Sep 17 00:00:00 2001 From: Mark Lentczner Date: Tue, 27 Jul 2010 21:23:58 +0000 Subject: remove custom version of copyFile in Xhtml.hs --- src/Haddock/Backends/Xhtml.hs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/Haddock') diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 491ab9eb..c9eaf71b 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -32,16 +32,13 @@ import Haddock.Utils import Text.XHtml hiding ( name, title, p, quote ) import Haddock.GhcUtils -import Control.Exception ( bracket ) import Control.Monad ( when, unless ) import Control.Monad.Instances ( ) -- for Functor Either a import Data.Char ( toUpper ) import Data.List ( sortBy, groupBy ) import Data.Maybe -import Foreign.Marshal.Alloc ( allocaBytes ) import System.FilePath hiding ( () ) -import System.IO ( IOMode(..), hClose, hGetBuf, hPutBuf, openFile ) -import System.Directory hiding ( copyFile ) +import System.Directory import Data.Map ( Map ) import qualified Data.Map as Map hiding ( Map ) import Data.List ( intercalate ) @@ -94,22 +91,6 @@ ppHtml doctitle maybe_package ifaces odir prologue maybe_contents_url maybe_index_url unicode) visible_ifaces -copyFile :: FilePath -> FilePath -> IO () -copyFile fromFPath toFPath = - (bracket (openFile fromFPath ReadMode) hClose $ \hFrom -> - bracket (openFile toFPath WriteMode) hClose $ \hTo -> - allocaBytes bufferSize $ \buffer -> - copyContents hFrom hTo buffer) - where - bufferSize = 1024 - - copyContents hFrom hTo buffer = do - count <- hGetBuf hFrom buffer bufferSize - when (count > 0) $ do - hPutBuf hTo buffer count - copyContents hFrom hTo buffer - - copyHtmlBits :: FilePath -> FilePath -> Themes -> IO () copyHtmlBits odir libdir themes = do let -- cgit v1.2.3