summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-27 01:15:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-27 01:15:28 -0400
commit9d9597d89d0447d59e920ef2a5fe6db83407c8b1 (patch)
treeae4a53c2d8d290d2c487e98e3525d458263fb355
parent8936ea18708940e167ff383731fad5e863b16000 (diff)
clean up build warnings with yesod 1.2, while still building with 1.1
-rw-r--r--Utility/Yesod.hs28
1 files 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