@@ -61,10 +61,12 @@ applyJoinTemplateList delimiter tpl context items = do
61-- @year-month-day-title.extension@ naming scheme -- as is the convention in
61-- @year-month-day-title.extension@ naming scheme -- as is the convention in
63chronological :: MonadMetadata m => [Item a] -> m [Item a]
63chronological :: MonadMetadata m => [Item a] -> m [Item a]
64−chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
65+ sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
65− where sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a]
67+ sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a]
66− sortByM f xs = liftM (map fst . sortBy (comparing snd)) $
68+ sortByM f xs = liftM (map fst . sortBy (comparing snd)) $
67− mapM (\x -> liftM (x,) (f x)) xs
69+ mapM (\x -> liftM (x,) (f x)) xs
69--------------------------------------------------------------------------------
71--------------------------------------------------------------------------------
70-- | The reverse of 'chronological'
72-- | The reverse of 'chronological'