diff options
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Web/Template/List.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Hakyll/Web/Template/List.hs b/src/Hakyll/Web/Template/List.hs index 1401119..9571b9e 100644 --- a/src/Hakyll/Web/Template/List.hs +++ b/src/Hakyll/Web/Template/List.hs @@ -61,10 +61,12 @@ applyJoinTemplateList delimiter tpl context items = do -- @year-month-day-title.extension@ naming scheme -- as is the convention in -- Hakyll. chronological :: MonadMetadata m => [Item a] -> m [Item a] -chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier - where sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a] - sortByM f xs = liftM (map fst . sortBy (comparing snd)) $ - mapM (\x -> liftM (x,) (f x)) xs +chronological = + sortByM $ getItemUTC defaultTimeLocale . itemIdentifier + where + sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a] + sortByM f xs = liftM (map fst . sortBy (comparing snd)) $ + mapM (\x -> liftM (x,) (f x)) xs -------------------------------------------------------------------------------- -- | The reverse of 'chronological' |