diff options
Diffstat (limited to 'Utility/Yesod.hs')
-rw-r--r-- | Utility/Yesod.hs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index 4f7fea8b5..ef9ad5fc5 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -1,11 +1,14 @@ {- Yesod stuff, that's typically found in the scaffolded site. - - - Copyright 2012 Joey Hess <joey@kitenet.net> + - Also a bit of a compatability layer to make it easier to support yesod + - 1.1 and 1.2 in the same code base. + - + - Copyright 2012, 2013 Joey Hess <joey@kitenet.net> - - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP, RankNTypes #-} module Utility.Yesod where @@ -16,6 +19,9 @@ import Language.Haskell.TH.Syntax import Data.Default (def) import Text.Hamlet #endif +#if MIN_VERSION_yesod_default(1,2,0) +import Yesod.Core +#endif widgetFile :: String -> Q Exp #if ! MIN_VERSION_yesod_default(1,1,0) @@ -31,3 +37,12 @@ widgetFile = widgetFileNoReload $ def hamletTemplate :: FilePath -> FilePath hamletTemplate f = globFile "hamlet" f #endif + +{- Lift Handler to Widget -} +#if ! MIN_VERSION_yesod(1,2,0) +liftH :: forall t. Lift t => t -> Q Exp +liftH = lift +#else +liftH :: Monad m => HandlerT site m a -> WidgetT site m a +liftH = liftH +#endif |