summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-27 18:46:23 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-27 18:46:23 +0100
commit6ffb83d46f0e1e82c38fa959464a98f6087f417f (patch)
tree040a96cc91625cd765671422b70db574528dbb3a /src/Hakyll
parenta1043203bb4ef5bc1af4c9a8957af36d163f03fb (diff)
downloadhakyll-6ffb83d46f0e1e82c38fa959464a98f6087f417f.tar.gz
Binary instance for Page
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Web/Page.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs
index 151364f..92303c1 100644
--- a/src/Hakyll/Web/Page.hs
+++ b/src/Hakyll/Web/Page.hs
@@ -7,8 +7,11 @@ module Hakyll.Web.Page
, toMap
) where
+import Control.Applicative ((<$>), (<*>))
+
import Data.Map (Map)
import qualified Data.Map as M
+import Data.Binary (Binary, get, put)
import Hakyll.Core.Writable
@@ -22,6 +25,10 @@ data Page a = Page
instance Functor Page where
fmap f (Page m b) = Page m (f b)
+instance Binary a => Binary (Page a) where
+ put (Page m b) = put m >> put b
+ get = Page <$> get <*> get
+
instance Writable a => Writable (Page a) where
write p (Page _ b) = write p b