summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Writable.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-04 11:46:06 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-04 11:46:06 +0100
commitbe685e6fcdbdb8d1bf49a09212413922a2e1ea82 (patch)
tree63ff2b5ad4b68e11304db7d6392c9a617b4c808f /src/Hakyll/Core/Writable.hs
parent40f503e0802a9be07ebd5fa965dec0e65f316f90 (diff)
downloadhakyll-be685e6fcdbdb8d1bf49a09212413922a2e1ea82.tar.gz
Add BlazeHtml integration
Diffstat (limited to 'src/Hakyll/Core/Writable.hs')
-rw-r--r--src/Hakyll/Core/Writable.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Hakyll/Core/Writable.hs b/src/Hakyll/Core/Writable.hs
index a3fd421..1253e19 100644
--- a/src/Hakyll/Core/Writable.hs
+++ b/src/Hakyll/Core/Writable.hs
@@ -1,6 +1,6 @@
-- | Describes writable items; items that can be saved to the disk
--
-{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
module Hakyll.Core.Writable
( Writable (..)
) where
@@ -8,6 +8,8 @@ module Hakyll.Core.Writable
import Data.Word (Word8)
import qualified Data.ByteString as SB
+import Text.Blaze (Html)
+import Text.Blaze.Renderer.String (renderHtml)
-- | Describes an item that can be saved to the disk
--
@@ -18,5 +20,11 @@ class Writable a where
instance Writable [Char] where
write = writeFile
+instance Writable SB.ByteString where
+ write p = SB.writeFile p
+
instance Writable [Word8] where
- write p = SB.writeFile p . SB.pack
+ write p = write p . SB.pack
+
+instance Writable Html where
+ write p html = write p $ renderHtml html