hamlet 0.9
This commit is contained in:
parent
86e3800951
commit
5a61ff5632
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod-core
|
||||
version: 0.8.3.2
|
||||
version: 0.9.0
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user