hamlet 0.5.1
This commit is contained in:
parent
60fab19ef6
commit
00a01936d4
@ -2,6 +2,7 @@
|
|||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE PackageImports #-}
|
{-# LANGUAGE PackageImports #-}
|
||||||
{-# LANGUAGE FlexibleInstances #-}
|
{-# LANGUAGE FlexibleInstances #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
-- | Widgets combine HTML with JS and CSS dependencies with a unique identifier
|
-- | Widgets combine HTML with JS and CSS dependencies with a unique identifier
|
||||||
-- generator, allowing you to create truly modular HTML components.
|
-- generator, allowing you to create truly modular HTML components.
|
||||||
module Yesod.Widget
|
module Yesod.Widget
|
||||||
@ -61,6 +62,19 @@ instance Monoid (GWidget sub master ()) where
|
|||||||
-- | A 'GWidget' specialized to when the subsite and master site are the same.
|
-- | A 'GWidget' specialized to when the subsite and master site are the same.
|
||||||
type Widget y = GWidget y y
|
type Widget y = GWidget y y
|
||||||
|
|
||||||
|
instance HamletValue (GWidget s m ()) where
|
||||||
|
newtype HamletMonad (GWidget s m ()) a =
|
||||||
|
GWidget' { runGWidget' :: GWidget s m a }
|
||||||
|
type HamletUrl (GWidget s m ()) = Route m
|
||||||
|
toHamletValue = runGWidget'
|
||||||
|
htmlToHamletMonad = GWidget' . addBody . const
|
||||||
|
urlToHamletMonad url params = GWidget' $
|
||||||
|
addBody $ \r -> preEscapedString (r url params)
|
||||||
|
fromHamletValue = GWidget'
|
||||||
|
instance Monad (HamletMonad (GWidget s m ())) where
|
||||||
|
return = GWidget' . return
|
||||||
|
x >>= y = GWidget' $ runGWidget' x >>= runGWidget' . y
|
||||||
|
|
||||||
-- | Lift an action in the 'GHandler' monad into an action in the 'GWidget'
|
-- | Lift an action in the 'GHandler' monad into an action in the 'GWidget'
|
||||||
-- monad.
|
-- monad.
|
||||||
liftHandler :: GHandler sub master a -> GWidget sub master a
|
liftHandler :: GHandler sub master a -> GWidget sub master a
|
||||||
|
|||||||
@ -32,7 +32,7 @@ library
|
|||||||
utf8-string >= 0.3.4 && < 0.4,
|
utf8-string >= 0.3.4 && < 0.4,
|
||||||
template-haskell >= 2.4 && < 2.5,
|
template-haskell >= 2.4 && < 2.5,
|
||||||
web-routes-quasi >= 0.6 && < 0.7,
|
web-routes-quasi >= 0.6 && < 0.7,
|
||||||
hamlet >= 0.5.0 && < 0.6,
|
hamlet >= 0.5.1 && < 0.6,
|
||||||
blaze-builder >= 0.1 && < 0.2,
|
blaze-builder >= 0.1 && < 0.2,
|
||||||
transformers >= 0.2 && < 0.3,
|
transformers >= 0.2 && < 0.3,
|
||||||
clientsession >= 0.4.0 && < 0.5,
|
clientsession >= 0.4.0 && < 0.5,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user