on master help sign in
Binary instance for Page
commit6ffb83d46f0e1e82c38fa959464a98f6087f417f authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 27 Dec 2010, 18:46 (16 years ago) parenta104320
1 file changed+7
src/Hakyll/Web/Page.hs+7
src/Hakyll/Web/Page.hs+7
@@ -7,8 +7,11 @@ module Hakyll.Web.Page
77 , toMap
88 ) where
99
10+import Control.Applicative ((<$>), (<*>))
11+
1012import Data.Map (Map)
1113import qualified Data.Map as M
14+import Data.Binary (Binary, get, put)
1215
1316import Hakyll.Core.Writable
1417
@@ -22,6 +25,10 @@ data Page a = Page
2225instance Functor Page where
2326 fmap f (Page m b) = Page m (f b)
2427
28+instance Binary a => Binary (Page a) where
29+ put (Page m b) = put m >> put b
30+ get = Page <$> get <*> get
31+
2532instance Writable a => Writable (Page a) where
2633 write p (Page _ b) = write p b
2734