Fix code style

This commit is contained in:
Simonas Kazlauskas 2013-02-23 13:38:34 +02:00
parent 45c618b413
commit 6b680c9887

View file

@ -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'