on master help sign in
Cleanup with hlint.
9591142Jasper Van der Jeugt
src/Text/Hakyll/File.hs+4−3
@@ -20,6 +20,7 @@ import System.FilePath
20import System.Time (ClockTime)
20import System.Time (ClockTime)
21import Control.Monad
21import Control.Monad
22import Data.List (isPrefixOf, sortBy)
22import Data.List (isPrefixOf, sortBy)
23+import Data.Ord (comparing)
23import Control.Monad.Reader (liftIO)
24import Control.Monad.Reader (liftIO)
24
25
25import Text.Hakyll.Hakyll
26import Text.Hakyll.Hakyll
@@ -83,9 +84,9 @@ toUrl path = do enableIndexUrl' <- askHakyll enableIndexUrl
83 , ".htm"
84 , ".htm"
84 , ".html"
85 , ".html"
85 ]
86 ]
86− isIndex = (dropExtension $ takeFileName path) == "index"
87+ isIndex = dropExtension (takeFileName path) == "index"
87 withSimpleHtmlExtension = flip addExtension ".html" $ dropExtension path
88 withSimpleHtmlExtension = flip addExtension ".html" $ dropExtension path
88− indexUrl = (dropExtension path) ++ "/"
89+ indexUrl = dropExtension path ++ "/"
89
90
90
91
91-- | Get the relative url to the site root, for a given (absolute) url
92-- | Get the relative url to the site root, for a given (absolute) url
@@ -131,7 +132,7 @@ getRecursiveContents topdir = do
131sortByBaseName :: [FilePath] -> [FilePath]
132sortByBaseName :: [FilePath] -> [FilePath]
132sortByBaseName = sortBy compareBaseName
133sortByBaseName = sortBy compareBaseName
133 where
134 where
134− compareBaseName f1 f2 = compare (takeFileName f1) (takeFileName f2)
135+ compareBaseName = comparing takeFileName
135
136
136-- | A filter that takes all file names with a given extension. Prefix the
137-- | A filter that takes all file names with a given extension. Prefix the
137-- extension with a dot:
138-- extension with a dot: