summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Writable
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-11-09 16:34:45 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-11-09 16:34:45 +0100
commit1319bbfe4ab3ddd321bcbb902bba7392ad868324 (patch)
tree5fdcad316015db237b18ff7e22e0e73c5044cc6f /src/Hakyll/Core/Writable
parentdac3fac342c2fb8610b6f1d83cbfd97a70cf17f1 (diff)
downloadhakyll-1319bbfe4ab3ddd321bcbb902bba7392ad868324.tar.gz
Remove Resource type
Diffstat (limited to 'src/Hakyll/Core/Writable')
-rw-r--r--src/Hakyll/Core/Writable/CopyFile.hs19
1 files changed, 13 insertions, 6 deletions
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