diff --git a/Yesod/Handler.hs b/Yesod/Handler.hs index 6533d435..34cfcc51 100644 --- a/Yesod/Handler.hs +++ b/Yesod/Handler.hs @@ -163,6 +163,8 @@ import Blaze.ByteString.Builder (toByteString) import Data.Text (Text) import Yesod.Message (RenderMessage (..)) +import Text.Blaze (toHtml, preEscapedText) + -- | The type-safe URLs associated with a site argument. type family Route a diff --git a/Yesod/Internal/Core.hs b/Yesod/Internal/Core.hs index 4c94c992..67de5592 100644 --- a/Yesod/Internal/Core.hs +++ b/Yesod/Internal/Core.hs @@ -74,6 +74,7 @@ import qualified Data.Text.Lazy.IO import qualified System.IO import qualified Data.Text.Lazy.Builder as TB import Language.Haskell.TH.Syntax (Loc (..), Lift (..)) +import Text.Blaze (preEscapedLazyText) #if GHC7 #define HAMLET hamlet diff --git a/Yesod/Widget.hs b/Yesod/Widget.hs index c575f77d..6bc4490c 100644 --- a/Yesod/Widget.hs +++ b/Yesod/Widget.hs @@ -74,8 +74,9 @@ import Language.Haskell.TH.Quote (QuasiQuoter) import Language.Haskell.TH.Syntax (Q, Exp (InfixE, VarE, LamE), Pat (VarP), newName) import Control.Monad.IO.Control (MonadControlIO) -import qualified Text.Hamlet.NonPoly as NP +import qualified Text.Hamlet as NP import Data.Text.Lazy.Builder (fromLazyText) +import Text.Blaze (toHtml, preEscapedLazyText) -- | A generic widget, allowing specification of both the subsite and master -- site datatypes. This is basically a large 'WriterT' stack keeping track of @@ -93,19 +94,6 @@ instance (Monad monad, a ~ ()) => Monoid (GGWidget master monad a) where mempty = return () mappend x y = x >> y -instance (Monad monad, a ~ ()) => HamletValue (GGWidget m monad a) where - newtype HamletMonad (GGWidget m monad a) b = - GWidget' { runGWidget' :: GGWidget m monad b } - type HamletUrl (GGWidget m monad a) = Route m - toHamletValue = runGWidget' - htmlToHamletMonad = GWidget' . addHtml - urlToHamletMonad url params = GWidget' $ - addHamlet $ \r -> preEscapedText (r url params) - fromHamletValue = GWidget' -instance (Monad monad, a ~ ()) => Monad (HamletMonad (GGWidget m monad a)) where - return = GWidget' . return - x >>= y = GWidget' $ runGWidget' x >>= runGWidget' . y - addSubWidget :: (YesodSubRoute sub master) => sub -> GWidget sub master a -> GWidget sub' master a addSubWidget sub (GWidget w) = do master <- lift getYesod diff --git a/yesod-core.cabal b/yesod-core.cabal index 6d1b06fd..b9d3a276 100644 --- a/yesod-core.cabal +++ b/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 0.8.3.2 +version: 0.9.0 license: BSD3 license-file: LICENSE author: Michael Snoyman @@ -34,7 +34,7 @@ library , text >= 0.5 && < 0.12 , template-haskell , web-routes-quasi >= 0.7.0.1 && < 0.8 - , hamlet >= 0.8.1 && < 0.9 + , hamlet >= 0.9 && < 0.10 , blaze-builder >= 0.2.1 && < 0.4 , transformers >= 0.2 && < 0.3 , clientsession >= 0.6 && < 0.7