on master help sign in
Fix code style
commit6b680c98873b91392e8e89d9ec4f008050f95f19 authorSimonas Kazlauskas <git@kazlauskas.me> dateSat 23 Feb 2013, 13:38 (14 years ago) parent45c618b
1 file changed+6−4
src/Hakyll/Web/Template/List.hs+6−4
src/Hakyll/Web/Template/List.hs+6−4
@@ -61,10 +61,12 @@ applyJoinTemplateList delimiter tpl context items = do
6161-- @year-month-day-title.extension@ naming scheme -- as is the convention in
6262-- Hakyll.
6363chronological :: MonadMetadata m => [Item a] -> m [Item a]
64−chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
65− where sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a]
66− sortByM f xs = liftM (map fst . sortBy (comparing snd)) $
67− mapM (\x -> liftM (x,) (f x)) xs
64+chronological =
65+ sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
66+ where
67+ sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a]
68+ sortByM f xs = liftM (map fst . sortBy (comparing snd)) $
69+ mapM (\x -> liftM (x,) (f x)) xs
6870
6971--------------------------------------------------------------------------------
7072-- | The reverse of 'chronological'