summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Web')
-rw-r--r--src/Hakyll/Web/Page/Internal.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Web/Page/Internal.hs b/src/Hakyll/Web/Page/Internal.hs
index bac4c51..3192141 100644
--- a/src/Hakyll/Web/Page/Internal.hs
+++ b/src/Hakyll/Web/Page/Internal.hs
@@ -6,10 +6,12 @@ module Hakyll.Web.Page.Internal
) where
import Control.Applicative ((<$>), (<*>))
+import Data.Monoid (Monoid, mempty, mappend)
import Data.Map (Map)
import Data.Binary (Binary, get, put)
import Data.Typeable (Typeable)
+import qualified Data.Map as M
import Hakyll.Core.Writable
@@ -20,6 +22,11 @@ data Page a = Page
, pageBody :: a
} deriving (Show, Typeable)
+instance Monoid a => Monoid (Page a) where
+ mempty = Page M.empty mempty
+ mappend (Page m1 b1) (Page m2 b2) =
+ Page (M.union m1 m2) (mappend b1 b2)
+
instance Functor Page where
fmap f (Page m b) = Page m (f b)