shakespeare 2.0.0 → 2.0.0.1
raw patch · 2 files changed
+19/−1 lines, 2 files
Files
- Text/Hamlet/RT.hs +18/−0
- shakespeare.cabal +1/−1
Text/Hamlet/RT.hs view
@@ -29,7 +29,13 @@ import Text.Blaze (preEscapedString, preEscapedText, Html) #endif import Data.Text (Text)++#if MIN_VERSION_exceptions(0,4,0) import Control.Monad.Catch (MonadThrow, throwM)+#else+import Control.Monad.Catch (MonadCatch, throwM)+#define MonadThrow MonadCatch+#endif type HamletMap url = [([String], HamletData url)] type UrlRenderer url = (url -> [(Text, Text)] -> Text)@@ -123,7 +129,11 @@ -> m Html renderHamletRT = renderHamletRT' False +#if MIN_VERSION_exceptions(0,4,0) renderHamletRT' :: MonadThrow m+#else+renderHamletRT' :: MonadCatch m+#endif => Bool -> HamletRT -> HamletMap url@@ -180,7 +190,11 @@ renderHamletRT' tempAsHtml (HamletRT docs') scope renderUrl HDBool False -> go scope (SDCond cs els) _ -> fa $ showName b ++ ": expected HDBool"+#if MIN_VERSION_exceptions(0,4,0) lookup' :: MonadThrow m+#else+ lookup' :: MonadCatch m+#endif => [String] -> [String] -> HamletMap url -> m (HamletData url) lookup' orig k m = case lookup k m of@@ -194,7 +208,11 @@ showName :: [String] -> String showName = intercalate "." . reverse +#if MIN_VERSION_exceptions(0,4,0) flattenDeref' :: MonadThrow f => Doc -> Deref -> f [String]+#else+flattenDeref' :: MonadCatch f => Doc -> Deref -> f [String]+#endif flattenDeref' orig deref = case flattenDeref deref of Nothing -> throwM $ HamletUnsupportedDocException orig
shakespeare.cabal view
@@ -1,5 +1,5 @@ name: shakespeare-version: 2.0.0+version: 2.0.0.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>