summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Tags.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-19 14:08:19 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-19 14:08:19 +0100
commitf5a6c4974d561e05b2882d38b54b45188ee31185 (patch)
tree4be6d29872ef395c2bbbc1550021abb88eddf979 /src/Text/Hakyll/Tags.hs
parente9dd4c75a21ee9bc8f42ea725d071974127a97d1 (diff)
downloadhakyll-f5a6c4974d561e05b2882d38b54b45188ee31185.tar.gz
Hakyll now passes HLint.
Diffstat (limited to 'src/Text/Hakyll/Tags.hs')
-rw-r--r--src/Text/Hakyll/Tags.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Text/Hakyll/Tags.hs b/src/Text/Hakyll/Tags.hs
index e15a41f..4059597 100644
--- a/src/Text/Hakyll/Tags.hs
+++ b/src/Text/Hakyll/Tags.hs
@@ -26,8 +26,8 @@ readTagMap paths = foldM addPaths M.empty paths
where
addPaths current path = do
page <- readPage path
- let tags = map trim $ splitRegex "," $ getValue ("tags") page
- return $ foldr (\t -> M.insertWith (++) t [path]) current tags
+ let tags = map trim $ splitRegex "," $ getValue "tags" page
+ return $ foldr (flip (M.insertWith (++)) [path]) current tags
-- | Render a tag cloud.
renderTagCloud :: M.Map String [FilePath] -- ^ Map as produced by "readTagMap".
@@ -50,10 +50,10 @@ renderTagCloud tagMap urlFunction minSize maxSize =
sizeTag count = show size' ++ "%"
where
size' :: Int
- size' = floor (minSize + (relative count) * (maxSize - minSize))
+ size' = floor $ minSize + relative count * (maxSize - minSize)
- minCount = minimum $ map snd $ tagCount
- maxCount = maximum $ map snd $ tagCount
+ minCount = minimum $ map snd tagCount
+ maxCount = maximum $ map snd tagCount
relative count = (count - minCount) / (maxCount - minCount)
tagCount :: [(String, Float)]
@@ -65,5 +65,5 @@ renderTagLinks :: (String -> String) -- ^ Function that produces an url for a ta
renderTagLinks urlFunction = renderValue "tags" "tags" renderTagLinks'
where
renderTagLinks' = intercalate ", "
- . map (\t -> link t $ urlFunction t)
- . map trim . splitRegex ","
+ . map ((\t -> link t $ urlFunction t) . trim)
+ . splitRegex ","