@@ -6,10 +6,12 @@ module Hakyll.Web.Page.Internal
66 ) where
77
88import Control.Applicative ((<$>), (<*>))
9+import Data.Monoid (Monoid, mempty, mappend)
910
1011import Data.Map (Map)
1112import Data.Binary (Binary, get, put)
1213import Data.Typeable (Typeable)
14+import qualified Data.Map as M
1315
1416import Hakyll.Core.Writable
1517
@@ -20,6 +22,11 @@ data Page a = Page
2022 , pageBody :: a
2123 } deriving (Show, Typeable)
2224
25+instance Monoid a => Monoid (Page a) where
26+ mempty = Page M.empty mempty
27+ mappend (Page m1 b1) (Page m2 b2) =
28+ Page (M.union m1 m2) (mappend b1 b2)
29+
2330instance Functor Page where
2431 fmap f (Page m b) = Page m (f b)
2532