1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-23 04:07:14 +03:00

Fix some warnings

This commit is contained in:
Artyom 2016-11-27 14:45:38 +03:00
parent bd1bd4c47c
commit 30426c0fc6
No known key found for this signature in database
GPG Key ID: B8E35A33FF522710
2 changed files with 10 additions and 12 deletions

View File

@ -18,7 +18,6 @@ where
import BasePrelude hiding (Category) import BasePrelude hiding (Category)
-- Monads and monad transformers -- Monads and monad transformers
import Control.Monad.Catch (MonadThrow)
import Control.Monad.State import Control.Monad.State
import Control.Monad.Reader import Control.Monad.Reader
import Control.Monad.Morph import Control.Monad.Morph
@ -729,7 +728,7 @@ otherMethods = do
Atom.feedLinks = [Atom.nullLink feedUrl] } Atom.feedLinks = [Atom.nullLink feedUrl] }
itemToFeedEntry itemToFeedEntry
:: (MonadIO m, MonadThrow m) :: (MonadIO m)
=> String -> Category -> Item -> m Atom.Entry => String -> Category -> Item -> m Atom.Entry
itemToFeedEntry baseUrl category item = do itemToFeedEntry baseUrl category item = do
entryContent <- Lucid.renderTextT (renderItemForFeed category item) entryContent <- Lucid.renderTextT (renderItemForFeed category item)

View File

@ -51,7 +51,6 @@ import BasePrelude hiding (Category)
import Lens.Micro.Platform hiding ((&)) import Lens.Micro.Platform hiding ((&))
-- Monads and monad transformers -- Monads and monad transformers
import Control.Monad.IO.Class import Control.Monad.IO.Class
import Control.Monad.Catch
import Control.Monad.Reader import Control.Monad.Reader
-- Lists -- Lists
import Data.List.Split import Data.List.Split
@ -194,7 +193,7 @@ enabled, and in this case the relevant tag will always be “shown” and not
-} -}
renderSubtitle :: (Monad m, MonadReader Config m) => HtmlT m () renderSubtitle :: (MonadReader Config m) => HtmlT m ()
renderSubtitle = renderSubtitle =
div_ [class_ "subtitle"] $ do div_ [class_ "subtitle"] $ do
"alpha version • don't post on Reddit yet" "alpha version • don't post on Reddit yet"
@ -536,18 +535,18 @@ renderEdit globalState edit = do
-- TODO: use “data Direction = Up | Down” for directions instead of Bool -- TODO: use “data Direction = Up | Down” for directions instead of Bool
-- | “Aelve Guide | Haskell” -- | “Aelve Guide | Haskell”
haskellHeader :: (Monad m, MonadReader Config m) => HtmlT m () haskellHeader :: (MonadReader Config m) => HtmlT m ()
haskellHeader = do haskellHeader = do
h1_ $ mkLink ("Aelve Guide " >> span_ "| Haskell") "/haskell" h1_ $ mkLink ("Aelve Guide " >> span_ "| Haskell") "/haskell"
renderSubtitle renderSubtitle
haskellHeaderMain :: (Monad m, MonadReader Config m) => HtmlT m () haskellHeaderMain :: (MonadReader Config m) => HtmlT m ()
haskellHeaderMain = do haskellHeaderMain = do
h1_ $ "Aelve Guide " >> span_ "| Haskell" h1_ $ "Aelve Guide " >> span_ "| Haskell"
renderSubtitle renderSubtitle
renderHaskellRoot renderHaskellRoot
:: (MonadIO m, MonadThrow m, MonadReader Config m) :: (MonadIO m, MonadReader Config m)
=> GlobalState -> Maybe Text -> HtmlT m () => GlobalState -> Maybe Text -> HtmlT m ()
renderHaskellRoot globalState mbSearchQuery = renderHaskellRoot globalState mbSearchQuery =
wrapPage "Aelve Guide | Haskell" $ do wrapPage "Aelve Guide | Haskell" $ do
@ -581,7 +580,7 @@ renderHaskellRoot globalState mbSearchQuery =
-- unfinished” -- unfinished”
renderCategoryPage renderCategoryPage
:: (MonadIO m, MonadThrow m, MonadReader Config m) :: (MonadIO m, MonadReader Config m)
=> Category -> HtmlT m () => Category -> HtmlT m ()
renderCategoryPage category = do renderCategoryPage category = do
wrapPage (category^.title <> " Haskell Aelve Guide") $ do wrapPage (category^.title <> " Haskell Aelve Guide") $ do
@ -685,7 +684,7 @@ wrapPage pageTitle page = doctypehtml_ $ do
mkLink "CC+ BY-SA 4.0" "/license" mkLink "CC+ BY-SA 4.0" "/license"
] ]
renderSearch :: (MonadIO m, MonadThrow m) => Maybe Text -> HtmlT m () renderSearch :: (MonadIO m) => Maybe Text -> HtmlT m ()
renderSearch mbSearchQuery = renderSearch mbSearchQuery =
mustache "search" $ A.object [ mustache "search" $ A.object [
"query" A..= mbSearchQuery ] "query" A..= mbSearchQuery ]
@ -906,13 +905,13 @@ renderItem category item = cached (CacheItem (item^.uid)) $ do
-- TODO: warn when a library isn't on Hackage but is supposed to be -- TODO: warn when a library isn't on Hackage but is supposed to be
renderItemTitle :: (MonadIO m, MonadThrow m) => Item -> HtmlT m () renderItemTitle :: (MonadIO m) => Item -> HtmlT m ()
renderItemTitle item = renderItemTitle item =
mustache "item-title" $ A.object [ mustache "item-title" $ A.object [
"item" A..= item ] "item" A..= item ]
-- TODO: give a link to oldest available docs when the new docs aren't there -- TODO: give a link to oldest available docs when the new docs aren't there
renderItemInfo :: (MonadIO m, MonadThrow m) => Category -> Item -> HtmlT m () renderItemInfo :: (MonadIO m) => Category -> Item -> HtmlT m ()
renderItemInfo cat item = cached (CacheItemInfo (item^.uid)) $ do renderItemInfo cat item = cached (CacheItemInfo (item^.uid)) $ do
let itemkindname :: Text let itemkindname :: Text
itemkindname = case item^.kind of itemkindname = case item^.kind of
@ -1137,7 +1136,7 @@ renderItemNotes category item = cached (CacheItemNotes (item^.uid)) $ do
return () return ()
renderItemForFeed renderItemForFeed
:: (MonadIO m, MonadThrow m) :: (MonadIO m)
=> Category -> Item -> HtmlT m () => Category -> Item -> HtmlT m ()
renderItemForFeed category item = do renderItemForFeed category item = do
h1_ $ renderItemTitle item h1_ $ renderItemTitle item