summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-01-07 15:12:22 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-01-07 15:12:22 +0100
commitc443d5c116b5bd62dfb4484bce784529678605e5 (patch)
treef39bb8cc5e0725c7e5bbaa15c298ef02600c4023 /src/Hakyll
parent672ecb077c7edd6a542958a2c9ede5c8ea14bbc4 (diff)
downloadhakyll-c443d5c116b5bd62dfb4484bce784529678605e5.tar.gz
Binary/Typeable/Writable instances for Tags
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Web/Tags.hs15
1 files changed, 14 insertions, 1 deletions
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
--