diff options
author | Joey Hess <joey@kitenet.net> | 2013-06-03 16:33:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-06-03 18:14:22 -0400 |
commit | 69a819844c4f062e4ed21d183bbce091c39ee7f8 (patch) | |
tree | c5a78d8af3d5dff45b1db3bb3c3f49efb57174ea /Utility/Yesod.hs | |
parent | c4e38c013f61d9b3482eb5592619e619d67b9146 (diff) |
now builds with both yesod 1.2 and 1.1
Diffstat (limited to 'Utility/Yesod.hs')
-rw-r--r-- | Utility/Yesod.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index ef9ad5fc5..e437326b0 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -8,20 +8,21 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP, RankNTypes #-} +{-# LANGUAGE CPP, RankNTypes, FlexibleContexts #-} module Utility.Yesod where +import Yesod +#if MIN_VERSION_yesod_default(1,2,0) +import Yesod.Core +#endif #ifndef __ANDROID__ import Yesod.Default.Util -import Language.Haskell.TH.Syntax +import Language.Haskell.TH.Syntax (Q, Exp) #if MIN_VERSION_yesod_default(1,1,0) 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) @@ -39,10 +40,10 @@ 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 +#if MIN_VERSION_yesod(1,2,0) liftH :: Monad m => HandlerT site m a -> WidgetT site m a liftH = liftH +#else +liftH :: MonadLift base m => base a -> m a +liftH = lift #endif |