@@ -1,6 +1,6 @@
11-- | Describes writable items; items that can be saved to the disk
22--
3−{-# LANGUAGE FlexibleInstances #-}
3+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
44module Hakyll.Core.Writable
55 ( Writable (..)
66 ) where
@@ -8,6 +8,8 @@ module Hakyll.Core.Writable
88import Data.Word (Word8)
99
1010import qualified Data.ByteString as SB
11+import Text.Blaze (Html)
12+import Text.Blaze.Renderer.String (renderHtml)
1113
1214-- | Describes an item that can be saved to the disk
1315--
@@ -18,5 +20,11 @@ class Writable a where
1820instance Writable [Char] where
1921 write = writeFile
2022
23+instance Writable SB.ByteString where
24+ write p = SB.writeFile p
25+
2126instance Writable [Word8] where
22− write p = SB.writeFile p . SB.pack
27+ write p = write p . SB.pack
28+
29+instance Writable Html where
30+ write p html = write p $ renderHtml html