@@ -40,7 +40,6 @@ module Hakyll.Web.Tags
4040import Prelude hiding (id)
4141import Control.Category (id)
4242import Control.Applicative ((<$>))
43−import Data.Map (Map)
4443import qualified Data.Map as M
4544import Data.List (intersperse, intercalate)
4645import Control.Arrow (arr, (&&&), (>>>), (***), (<<^), returnA)
@@ -65,7 +64,7 @@ import Hakyll.Core.Util.String
6564-- | Data about tags
6665--
6766data Tags a = Tags
68− { tagsMap :: Map String [Page a]
67+ { tagsMap :: [(String, [Page a])]
6968 } deriving (Show, Typeable)
7069
7170instance Binary a => Binary (Tags a) where
@@ -91,7 +90,8 @@ readTagsWith :: (Page a -> [String]) -- ^ Function extracting tags from a page
9190 -> [Page a] -- ^ Pages
9291 -> Tags a -- ^ Resulting tags
9392readTagsWith f pages = Tags
94− { tagsMap = foldl (M.unionWith (++)) M.empty (map readTagsWith' pages)
93+ { tagsMap = M.toList $
94+ foldl (M.unionWith (++)) M.empty (map readTagsWith' pages)
9595 }
9696 where
9797 -- Create a tag map for one page
@@ -122,7 +122,7 @@ renderTags :: (String -> Identifier)
122122renderTags makeUrl makeItem concatItems = proc (Tags tags) -> do
123123 -- In tags' we create a list: [((tag, route), count)]
124124 tags' <- mapCompiler ((id &&& (getRouteFor <<^ makeUrl)) *** arr length)
125− -< M.toList tags
125+ -< tags
126126
127127 let -- Absolute frequencies of the pages
128128 freqs = map snd tags'