From 9d9597d89d0447d59e920ef2a5fe6db83407c8b1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Jun 2013 01:15:28 -0400 Subject: clean up build warnings with yesod 1.2, while still building with 1.1 --- Utility/Yesod.hs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index cb5c68c82..68d80d579 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -10,18 +10,28 @@ {-# LANGUAGE CPP, RankNTypes, FlexibleContexts #-} -module Utility.Yesod where +module Utility.Yesod + ( module Y + , widgetFile + , hamletTemplate + , liftH +#if ! MIN_VERSION_yesod(1,2,0) + , giveUrlRenderer + , Html +#endif + ) where -import Yesod -#if MIN_VERSION_yesod_default(1,2,0) -import Yesod.Core +#if MIN_VERSION_yesod(1,2,0) +import Yesod as Y +#else +import Yesod as Y hiding (Html) #endif #ifndef __ANDROID__ import Yesod.Default.Util import Language.Haskell.TH.Syntax (Q, Exp) #if MIN_VERSION_yesod_default(1,1,0) import Data.Default (def) -import Text.Hamlet +import Text.Hamlet hiding (Html) #endif widgetFile :: String -> Q Exp @@ -47,3 +57,11 @@ liftH = handlerToWidget liftH :: MonadLift base m => base a -> m a liftH = lift #endif + +{- Misc new names for stuff. -} +#if ! MIN_VERSION_yesod(1,2,0) +giveUrlRenderer :: forall master sub. HtmlUrl (Route master) -> GHandler sub master RepHtml +giveUrlRenderer = hamletToRepHtml + +type Html = RepHtml +#endif -- cgit v1.2.3