From c443d5c116b5bd62dfb4484bce784529678605e5 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 7 Jan 2011 15:12:22 +0100 Subject: Binary/Typeable/Writable instances for Tags --- src/Hakyll/Web/Tags.hs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs index 4986a31..cf0d9a5 100644 --- a/src/Hakyll/Web/Tags.hs +++ b/src/Hakyll/Web/Tags.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveDataTypeable #-} module Hakyll.Web.Tags ( Tags (..) , readTagsWith @@ -5,17 +6,29 @@ module Hakyll.Web.Tags , readCategories ) where +import Control.Applicative ((<$>)) import Data.Map (Map) import qualified Data.Map as M +import Data.Typeable (Typeable) +import Data.Binary (Binary, get, put) + import Hakyll.Web.Page import Hakyll.Web.Util.String +import Hakyll.Core.Writable -- | Data about tags -- data Tags a = Tags { tagsMap :: Map String [Page a] - } deriving (Show) + } deriving (Show, Typeable) + +instance Binary a => Binary (Tags a) where + get = Tags <$> get + put (Tags m) = put m + +instance Writable (Tags a) where + write _ _ = return () -- | Higher-level function to read tags -- -- cgit v1.2.3