From 1319bbfe4ab3ddd321bcbb902bba7392ad868324 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 9 Nov 2012 16:34:45 +0100 Subject: Remove Resource type --- src/Hakyll/Core/Writable/CopyFile.hs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/Hakyll/Core/Writable') diff --git a/src/Hakyll/Core/Writable/CopyFile.hs b/src/Hakyll/Core/Writable/CopyFile.hs index ab9c698..6cc08f2 100644 --- a/src/Hakyll/Core/Writable/CopyFile.hs +++ b/src/Hakyll/Core/Writable/CopyFile.hs @@ -1,29 +1,36 @@ +-------------------------------------------------------------------------------- -- | Exports simple compilers to just copy files --- {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Hakyll.Core.Writable.CopyFile ( CopyFile (..) , copyFileCompiler ) where + +-------------------------------------------------------------------------------- import Control.Arrow ((>>^)) import System.Directory (copyFile) - import Data.Typeable (Typeable) import Data.Binary (Binary) -import Hakyll.Core.Resource + +-------------------------------------------------------------------------------- import Hakyll.Core.Writable import Hakyll.Core.Compiler import Hakyll.Core.Identifier + +-------------------------------------------------------------------------------- -- | Newtype construct around 'FilePath' which will copy the file directly --- newtype CopyFile = CopyFile {unCopyFile :: FilePath} - deriving (Show, Eq, Ord, Binary, Typeable) + deriving (Show, Eq, Ord, Binary, Typeable) + +-------------------------------------------------------------------------------- instance Writable CopyFile where write dst (CopyFile src) = copyFile src dst -copyFileCompiler :: Compiler Resource CopyFile + +-------------------------------------------------------------------------------- +copyFileCompiler :: Compiler a CopyFile copyFileCompiler = getIdentifier >>^ CopyFile . toFilePath -- cgit v1.2.3