on master help sign in
Binary instance for Page
6ffb83dJasper Van der Jeugt
src/Hakyll/Web/Page.hs+7
@@ -7,8 +7,11 @@ module Hakyll.Web.Page
7 , toMap
7 , toMap
8 ) where
8 ) where
9
9
10+import Control.Applicative ((<$>), (<*>))
11+
10import Data.Map (Map)
12import Data.Map (Map)
11import qualified Data.Map as M
13import qualified Data.Map as M
14+import Data.Binary (Binary, get, put)
12
15
13import Hakyll.Core.Writable
16import Hakyll.Core.Writable
14
17
@@ -22,6 +25,10 @@ data Page a = Page
22instance Functor Page where
25instance Functor Page where
23 fmap f (Page m b) = Page m (f b)
26 fmap f (Page m b) = Page m (f b)
24
27
28+instance Binary a => Binary (Page a) where
29+ put (Page m b) = put m >> put b
30+ get = Page <$> get <*> get
31+
25instance Writable a => Writable (Page a) where
32instance Writable a => Writable (Page a) where
26 write p (Page _ b) = write p b
33 write p (Page _ b) = write p b
27
34