From f5a6c4974d561e05b2882d38b54b45188ee31185 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 19 Jan 2010 14:08:19 +0100 Subject: Hakyll now passes HLint. --- src/Text/Hakyll/Render/Internal.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Hakyll/Render') diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs index d4c1697..89a2709 100644 --- a/src/Text/Hakyll/Render/Internal.hs +++ b/src/Text/Hakyll/Render/Internal.hs @@ -30,10 +30,10 @@ substitute _ [] _ = [] substitute escaper string context | "$$" `isPrefixOf` string = escaper ++ substitute' (tail tail') | "$" `isPrefixOf` string = substituteKey - | otherwise = (head string) : (substitute' tail') + | otherwise = head string : substitute' tail' where tail' = tail string - (key, rest) = break (not . isAlpha) tail' + (key, rest) = span isAlpha tail' replacement = fromMaybe ('$' : key) $ M.lookup key context substituteKey = replacement ++ substitute' rest substitute' str = substitute escaper str context @@ -86,7 +86,7 @@ writePage :: Page -> Hakyll () writePage page = do additionalContext' <- askHakyll additionalContext let destination = toDestination url - context = additionalContext' `M.union` (M.singleton "root" $ toRoot url) + context = additionalContext' `M.union` M.singleton "root" (toRoot url) makeDirectories destination     -- Substitute $root here, just before writing. liftIO $ writeFile destination $ finalSubstitute (getBody page) context -- cgit v1.2.3