summaryrefslogtreecommitdiff
path: root/lib/Hakyll/Web
diff options
context:
space:
mode:
authorVeronika Romashkina <vrom911@gmail.com>2020-02-26 10:49:03 +0000
committerGitHub <noreply@github.com>2020-02-26 11:49:03 +0100
commitd2ee5b2b0eb2afb970ab8d4feed84434dc8236e0 (patch)
tree56a3be8e658dfc134259c61314cca00964f692d8 /lib/Hakyll/Web
parent7b924e7d6b98db7de64fa8fc5cae14a3ea35965c (diff)
downloadhakyll-d2ee5b2b0eb2afb970ab8d4feed84434dc8236e0.tar.gz
Support GHC-8.8
Add MonadFail instances and constraints.
Diffstat (limited to 'lib/Hakyll/Web')
-rw-r--r--lib/Hakyll/Web/Template/Context.hs2
-rw-r--r--lib/Hakyll/Web/Template/List.hs8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Hakyll/Web/Template/Context.hs b/lib/Hakyll/Web/Template/Context.hs
index 8627d5b..a5049c2 100644
--- a/lib/Hakyll/Web/Template/Context.hs
+++ b/lib/Hakyll/Web/Template/Context.hs
@@ -365,7 +365,7 @@ dateFieldWith locale key format = field key $ \i -> do
-- | Parser to try to extract and parse the time from the @published@
-- field or from the filename. See 'dateField' for more information.
-- Exported for user convenience.
-getItemUTC :: MonadMetadata m
+getItemUTC :: (MonadMetadata m, MonadFail m)
=> TimeLocale -- ^ Output time locale
-> Identifier -- ^ Input page
-> m UTCTime -- ^ Parsed UTCTime
diff --git a/lib/Hakyll/Web/Template/List.hs b/lib/Hakyll/Web/Template/List.hs
index 4d769fc..db3fff1 100644
--- a/lib/Hakyll/Web/Template/List.hs
+++ b/lib/Hakyll/Web/Template/List.hs
@@ -60,7 +60,7 @@ applyJoinTemplateList delimiter tpl context items = do
--------------------------------------------------------------------------------
-- | Sort pages chronologically. Uses the same method as 'dateField' for
-- extracting the date.
-chronological :: MonadMetadata m => [Item a] -> m [Item a]
+chronological :: (MonadMetadata m, MonadFail m) => [Item a] -> m [Item a]
chronological =
sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
where
@@ -71,14 +71,14 @@ chronological =
--------------------------------------------------------------------------------
-- | The reverse of 'chronological'
-recentFirst :: MonadMetadata m => [Item a] -> m [Item a]
+recentFirst :: (MonadMetadata m, MonadFail m) => [Item a] -> m [Item a]
recentFirst = liftM reverse . chronological
--------------------------------------------------------------------------------
-- | Version of 'chronological' which doesn't need the actual items.
sortChronological
- :: MonadMetadata m => [Identifier] -> m [Identifier]
+ :: (MonadMetadata m, MonadFail m) => [Identifier] -> m [Identifier]
sortChronological ids =
liftM (map itemIdentifier) $ chronological [Item i () | i <- ids]
@@ -86,6 +86,6 @@ sortChronological ids =
--------------------------------------------------------------------------------
-- | Version of 'recentFirst' which doesn't need the actual items.
sortRecentFirst
- :: MonadMetadata m => [Identifier] -> m [Identifier]
+ :: (MonadMetadata m, MonadFail m) => [Identifier] -> m [Identifier]
sortRecentFirst ids =
liftM (map itemIdentifier) $ recentFirst [Item i () | i <- ids]