    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE QuasiQuotes #-}
    {-# LANGUAGE RankNTypes #-}
    {-# LANGUAGE TemplateHaskell #-}
    {-# LANGUAGE TupleSections #-}
    {-# LANGUAGE TypeFamilies #-}
    {-# LANGUAGE TypeOperators #-}
    {-# LANGUAGE TypeSynonymInstances #-}
    {-# LANGUAGE UndecidableInstances #-}

    -- | Widgets combine HTML with JS and CSS dependencies with a unique identifier
    -- generator, allowing you to create truly modular HTML components.
    module Yesod.Core.Widget
        ( -- * Datatype
          WidgetT
        , WidgetFor
        , PageContent (..)
          -- * Special Hamlet quasiquoter/TH for Widgets
        , whamlet
        , whamletFile
        , ihamletToRepHtml
        , ihamletToHtml
          -- * Convert to Widget
        , ToWidget (..)
        , ToWidgetHead (..)
        , ToWidgetBody (..)
        , ToWidgetMedia (..)
          -- * Creating
          -- ** Head of page
        , setTitle
        , setTitleI
        , setDescription
        , setDescriptionI
        , setDescriptionIdemp
        , setDescriptionIdempI
        , setOGType
        , setOGImage
          -- ** CSS
        , addStylesheet
        , addStylesheetAttrs
        , addStylesheetRemote
        , addStylesheetRemoteAttrs
        , addStylesheetEither
        , CssBuilder (..)
          -- ** Javascript
        , addScript
        , addScriptAttrs
        , addScriptRemote
        , addScriptRemoteAttrs
        , addScriptEither
          -- * Subsites
        , handlerToWidget
          -- * Internal
        , whamletFileWithSettings
        , asWidgetT
        ) where

    import Data.Monoid (Last (..))
    import qualified Text.Blaze.Html5 as H
    import Text.Hamlet
    import Text.Cassius
    import Text.Julius
    import Yesod.Routes.Class
    import Yesod.Core.Handler (getMessageRender, getUrlRenderParams)
    import Text.Shakespeare.I18N (RenderMessage)
    import Data.Text (Text)
    import Data.Kind (Type)
    import qualified Data.Map as Map
    import Language.Haskell.TH.Quote (QuasiQuoter)
    import Language.Haskell.TH.Syntax (Q, Exp (InfixE, VarE, LamE, AppE), Pat (VarP), newName)

    import qualified Text.Hamlet as NP
    import Data.Text.Lazy.Builder (fromLazyText)
    import Text.Blaze.Html (toHtml, preEscapedToMarkup)
    import qualified Data.Text.Lazy as TL
    import qualified Data.Text.Lazy.Builder as TB

    import Yesod.Core.Types
    import Yesod.Core.Class.Handler

    type WidgetT site (m :: Type -> Type) = WidgetFor site
    {-# DEPRECATED WidgetT "Use WidgetFor directly" #-}

    preEscapedLazyText :: TL.Text -> Html
    preEscapedLazyText :: Text -> Html
    preEscapedLazyText = Text -> Html
    forall a. ToMarkup a => a -> Html
    preEscapedToMarkup

    class ToWidget site a where
        toWidget :: (MonadWidget m, HandlerSite m ~ site) => a -> m ()

    instance render ~ RY site => ToWidget site (render -> Html) where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Html) -> m ()
    toWidget render -> Html
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData (HtmlUrl (Route site) -> Body (Route site)
    forall url. HtmlUrl url -> Body url
    Body render -> Html
    HtmlUrl (Route site)
    x) Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty Head (Route site)
    forall a. Monoid a => a
    mempty
    instance render ~ RY site => ToWidget site (render -> Css) where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Css) -> m ()
    toWidget render -> Css
    x = (render -> CssBuilder) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> CssBuilder) -> m ()
    toWidget ((render -> CssBuilder) -> m ()) -> (render -> CssBuilder) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Builder -> CssBuilder
    CssBuilder (Builder -> CssBuilder)
    -> (render -> Builder) -> render -> CssBuilder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Builder
    fromLazyText (Text -> Builder) -> (render -> Text) -> render -> Builder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> Text
    renderCss (Css -> Text) -> (render -> Css) -> render -> Text
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . render -> Css
    x
    instance ToWidget site Css where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Css -> m ()
    toWidget Css
    x = (RY site -> CssBuilder) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> CssBuilder) -> m ()
    toWidget ((RY site -> CssBuilder) -> m ())
    -> (RY site -> CssBuilder) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Builder -> CssBuilder
    CssBuilder (Builder -> CssBuilder)
    -> (RY site -> Builder) -> RY site -> CssBuilder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Builder
    fromLazyText (Text -> Builder) -> (RY site -> Text) -> RY site -> Builder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> Text
    renderCss (Css -> Text) -> (RY site -> Css) -> RY site -> Text
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> RY site -> Css
    forall a b. a -> b -> a
    const Css
    x
    instance render ~ RY site => ToWidget site (render -> CssBuilder) where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> CssBuilder) -> m ()
    toWidget render -> CssBuilder
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty (Maybe Text
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall k a. k -> a -> Map k a
    Map.singleton Maybe Text
    forall a. Maybe a
    Nothing (CssBuilderUrl (Route site)
     -> Map (Maybe Text) (CssBuilderUrl (Route site)))
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a b. (a -> b) -> a -> b
    $ CssBuilder -> Builder
    unCssBuilder (CssBuilder -> Builder)
    -> (RY site -> CssBuilder) -> CssBuilderUrl (Route site)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . render -> CssBuilder
    RY site -> CssBuilder
    x) Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty Head (Route site)
    forall a. Monoid a => a
    mempty
    instance ToWidget site CssBuilder where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    CssBuilder -> m ()
    toWidget CssBuilder
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty (Maybe Text
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall k a. k -> a -> Map k a
    Map.singleton Maybe Text
    forall a. Maybe a
    Nothing (CssBuilderUrl (Route site)
     -> Map (Maybe Text) (CssBuilderUrl (Route site)))
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a b. (a -> b) -> a -> b
    $ CssBuilder -> Builder
    unCssBuilder (CssBuilder -> Builder)
    -> ((Route site -> [(Text, Text)] -> Text) -> CssBuilder)
    -> CssBuilderUrl (Route site)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CssBuilder -> (Route site -> [(Text, Text)] -> Text) -> CssBuilder
    forall a b. a -> b -> a
    const CssBuilder
    x) Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty Head (Route site)
    forall a. Monoid a => a
    mempty
    instance render ~ RY site => ToWidget site (render -> Javascript) where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Javascript) -> m ()
    toWidget render -> Javascript
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a. Monoid a => a
    mempty (JavascriptUrl (Route site) -> Maybe (JavascriptUrl (Route site))
    forall a. a -> Maybe a
    Just render -> Javascript
    JavascriptUrl (Route site)
    x) Head (Route site)
    forall a. Monoid a => a
    mempty
    instance ToWidget site Javascript where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Javascript -> m ()
    toWidget Javascript
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a. Monoid a => a
    mempty (JavascriptUrl (Route site) -> Maybe (JavascriptUrl (Route site))
    forall a. a -> Maybe a
    Just (JavascriptUrl (Route site) -> Maybe (JavascriptUrl (Route site)))
    -> JavascriptUrl (Route site) -> Maybe (JavascriptUrl (Route site))
    forall a b. (a -> b) -> a -> b
    $ Javascript -> JavascriptUrl (Route site)
    forall a b. a -> b -> a
    const Javascript
    x) Head (Route site)
    forall a. Monoid a => a
    mempty
    instance (site' ~ site, a ~ ()) => ToWidget site' (WidgetFor site a) where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site') =>
    WidgetFor site a -> m ()
    toWidget = WidgetFor site a -> m ()
    WidgetFor (HandlerSite m) a -> m a
    forall a. WidgetFor (HandlerSite m) a -> m a
    forall (m :: * -> *) a.
    MonadWidget m =>
    WidgetFor (HandlerSite m) a -> m a
    liftWidget
    instance ToWidget site Html where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidget = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidget ((RY site -> Html) -> m ())
    -> (Html -> RY site -> Html) -> Html -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Html -> RY site -> Html
    forall a b. a -> b -> a
    const
    -- | @since 1.4.28
    instance ToWidget site Text where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> m ()
    toWidget = Html -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidget (Html -> m ()) -> (Text -> Html) -> Text -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Html
    forall a. ToMarkup a => a -> Html
    toHtml
    -- | @since 1.4.28
    instance ToWidget site TL.Text where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> m ()
    toWidget = Html -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidget (Html -> m ()) -> (Text -> Html) -> Text -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Html
    forall a. ToMarkup a => a -> Html
    toHtml
    -- | @since 1.4.28
    instance ToWidget site TB.Builder where
        toWidget :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Builder -> m ()
    toWidget = Html -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidget (Html -> m ()) -> (Builder -> Html) -> Builder -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Builder -> Html
    forall a. ToMarkup a => a -> Html
    toHtml

    -- | Allows adding some CSS to the page with a specific media type.
    --
    -- Since 1.2
    class ToWidgetMedia site a where
        -- | Add the given content to the page, but only for the given media type.
        --
        -- Since 1.2
        toWidgetMedia :: (MonadWidget m, HandlerSite m ~ site)
                      => Text -- ^ media value
                      -> a
                      -> m ()
    instance render ~ RY site => ToWidgetMedia site (render -> Css) where
        toWidgetMedia :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> (render -> Css) -> m ()
    toWidgetMedia Text
    media render -> Css
    x = Text -> (render -> CssBuilder) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetMedia site a, MonadWidget m, HandlerSite m ~ site) =>
    Text -> a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> (render -> CssBuilder) -> m ()
    toWidgetMedia Text
    media ((render -> CssBuilder) -> m ()) -> (render -> CssBuilder) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Builder -> CssBuilder
    CssBuilder (Builder -> CssBuilder)
    -> (render -> Builder) -> render -> CssBuilder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Builder
    fromLazyText (Text -> Builder) -> (render -> Text) -> render -> Builder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> Text
    renderCss (Css -> Text) -> (render -> Css) -> render -> Text
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . render -> Css
    x
    instance ToWidgetMedia site Css where
        toWidgetMedia :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> Css -> m ()
    toWidgetMedia Text
    media Css
    x = Text -> (RY site -> CssBuilder) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetMedia site a, MonadWidget m, HandlerSite m ~ site) =>
    Text -> a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> (RY site -> CssBuilder) -> m ()
    toWidgetMedia Text
    media ((RY site -> CssBuilder) -> m ())
    -> (RY site -> CssBuilder) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Builder -> CssBuilder
    CssBuilder (Builder -> CssBuilder)
    -> (RY site -> Builder) -> RY site -> CssBuilder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Builder
    fromLazyText (Text -> Builder) -> (RY site -> Text) -> RY site -> Builder
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> Text
    renderCss (Css -> Text) -> (RY site -> Css) -> RY site -> Text
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Css -> RY site -> Css
    forall a b. a -> b -> a
    const Css
    x
    instance render ~ RY site => ToWidgetMedia site (render -> CssBuilder) where
        toWidgetMedia :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> (render -> CssBuilder) -> m ()
    toWidgetMedia Text
    media render -> CssBuilder
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty (Maybe Text
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall k a. k -> a -> Map k a
    Map.singleton (Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    media) (CssBuilderUrl (Route site)
     -> Map (Maybe Text) (CssBuilderUrl (Route site)))
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a b. (a -> b) -> a -> b
    $ CssBuilder -> Builder
    unCssBuilder (CssBuilder -> Builder)
    -> (RY site -> CssBuilder) -> CssBuilderUrl (Route site)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . render -> CssBuilder
    RY site -> CssBuilder
    x) Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty Head (Route site)
    forall a. Monoid a => a
    mempty
    instance ToWidgetMedia site CssBuilder where
        toWidgetMedia :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Text -> CssBuilder -> m ()
    toWidgetMedia Text
    media CssBuilder
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty (Maybe Text
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall k a. k -> a -> Map k a
    Map.singleton (Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    media) (CssBuilderUrl (Route site)
     -> Map (Maybe Text) (CssBuilderUrl (Route site)))
    -> CssBuilderUrl (Route site)
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a b. (a -> b) -> a -> b
    $ CssBuilder -> Builder
    unCssBuilder (CssBuilder -> Builder)
    -> ((Route site -> [(Text, Text)] -> Text) -> CssBuilder)
    -> CssBuilderUrl (Route site)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CssBuilder -> (Route site -> [(Text, Text)] -> Text) -> CssBuilder
    forall a b. a -> b -> a
    const CssBuilder
    x) Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty Head (Route site)
    forall a. Monoid a => a
    mempty

    class ToWidgetBody site a where
        toWidgetBody :: (MonadWidget m, HandlerSite m ~ site) => a -> m ()

    instance render ~ RY site => ToWidgetBody site (render -> Html) where
        toWidgetBody :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Html) -> m ()
    toWidgetBody = (render -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Html) -> m ()
    toWidget
    instance render ~ RY site => ToWidgetBody site (render -> Javascript) where
        toWidgetBody :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Javascript) -> m ()
    toWidgetBody render -> Javascript
    j = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidget ((RY site -> Html) -> m ()) -> (RY site -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ \RY site
    r -> Html -> Html
    H.script (Html -> Html) -> Html -> Html
    forall a b. (a -> b) -> a -> b
    $ Text -> Html
    preEscapedLazyText (Text -> Html) -> Text -> Html
    forall a b. (a -> b) -> a -> b
    $ RY site -> JavascriptUrl (Route site) -> Text
    forall url.
    (url -> [(Text, Text)] -> Text) -> JavascriptUrl url -> Text
    renderJavascriptUrl RY site
    r render -> Javascript
    JavascriptUrl (Route site)
    j
    instance ToWidgetBody site Javascript where
        toWidgetBody :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Javascript -> m ()
    toWidgetBody Javascript
    j = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidget ((RY site -> Html) -> m ()) -> (RY site -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ \RY site
    _ -> Html -> Html
    H.script (Html -> Html) -> Html -> Html
    forall a b. (a -> b) -> a -> b
    $ Text -> Html
    preEscapedLazyText (Text -> Html) -> Text -> Html
    forall a b. (a -> b) -> a -> b
    $ Javascript -> Text
    renderJavascript Javascript
    j
    instance ToWidgetBody site Html where
        toWidgetBody :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidgetBody = Html -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidget

    class ToWidgetHead site a where
        toWidgetHead :: (MonadWidget m, HandlerSite m ~ site) => a -> m ()

    instance render ~ RY site => ToWidgetHead site (render -> Html) where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Html) -> m ()
    toWidgetHead = GWData (Route site) -> m ()
    GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route site) -> m ())
    -> ((render -> Html) -> GWData (Route site))
    -> (render -> Html)
    -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Body (Route site)
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route site))
    -> UniqueList (Stylesheet (Route site))
    -> Map (Maybe Text) (CssBuilderUrl (Route site))
    -> Maybe (JavascriptUrl (Route site))
    -> Head (Route site)
    -> GWData (Route site)
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route site)
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route site))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route site))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route site))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route site))
    forall a. Monoid a => a
    mempty (Head (Route site) -> GWData (Route site))
    -> ((render -> Html) -> Head (Route site))
    -> (render -> Html)
    -> GWData (Route site)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (render -> Html) -> Head (Route site)
    HtmlUrl (Route site) -> Head (Route site)
    forall url. HtmlUrl url -> Head url
    Head
    instance render ~ RY site => ToWidgetHead site (render -> Css) where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Css) -> m ()
    toWidgetHead = (render -> Css) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Css) -> m ()
    toWidget
    instance ToWidgetHead site Css where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Css -> m ()
    toWidgetHead = Css -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Css -> m ()
    toWidget
    instance render ~ RY site => ToWidgetHead site (render -> CssBuilder) where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> CssBuilder) -> m ()
    toWidgetHead = (render -> CssBuilder) -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> CssBuilder) -> m ()
    toWidget
    instance ToWidgetHead site CssBuilder where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    CssBuilder -> m ()
    toWidgetHead = CssBuilder -> m ()
    forall site a (m :: * -> *).
    (ToWidget site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    CssBuilder -> m ()
    toWidget
    instance render ~ RY site => ToWidgetHead site (render -> Javascript) where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (render -> Javascript) -> m ()
    toWidgetHead render -> Javascript
    j = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidgetHead ((RY site -> Html) -> m ()) -> (RY site -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ \RY site
    r -> Html -> Html
    H.script (Html -> Html) -> Html -> Html
    forall a b. (a -> b) -> a -> b
    $ Text -> Html
    preEscapedLazyText (Text -> Html) -> Text -> Html
    forall a b. (a -> b) -> a -> b
    $ RY site -> JavascriptUrl (Route site) -> Text
    forall url.
    (url -> [(Text, Text)] -> Text) -> JavascriptUrl url -> Text
    renderJavascriptUrl RY site
    r render -> Javascript
    JavascriptUrl (Route site)
    j
    instance ToWidgetHead site Javascript where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Javascript -> m ()
    toWidgetHead Javascript
    j = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidgetHead ((RY site -> Html) -> m ()) -> (RY site -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ \RY site
    _ -> Html -> Html
    H.script (Html -> Html) -> Html -> Html
    forall a b. (a -> b) -> a -> b
    $ Text -> Html
    preEscapedLazyText (Text -> Html) -> Text -> Html
    forall a b. (a -> b) -> a -> b
    $ Javascript -> Text
    renderJavascript Javascript
    j
    instance ToWidgetHead site Html where
        toWidgetHead :: forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    Html -> m ()
    toWidgetHead = (RY site -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ site) =>
    (RY site -> Html) -> m ()
    toWidgetHead ((RY site -> Html) -> m ())
    -> (Html -> RY site -> Html) -> Html -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Html -> RY site -> Html
    forall a b. a -> b -> a
    const

    -- | Set the page title.
    --
    -- Calling @setTitle@ or @setTitleI@ multiple times overrides previously set
    -- values.
    --
    -- SEO Notes:
    --
    --    * Title tags are the second most important on-page factor for SEO, after
    --      content
    --    * Every page should have a unique title tag
    --    * Start your title tag with your main targeted keyword
    --    * Don't stuff your keywords
    --    * Google typically shows 55-64 characters, so aim to keep your title
    --      length under 60 characters
    setTitle :: MonadWidget m => Html -> m ()
    setTitle :: forall (m :: * -> *). MonadWidget m => Html -> m ()
    setTitle Html
    x = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty (Maybe Title -> Last Title
    forall a. Maybe a -> Last a
    Last (Maybe Title -> Last Title) -> Maybe Title -> Last Title
    forall a b. (a -> b) -> a -> b
    $ Title -> Maybe Title
    forall a. a -> Maybe a
    Just (Title -> Maybe Title) -> Title -> Maybe Title
    forall a b. (a -> b) -> a -> b
    $ Html -> Title
    Title Html
    x) Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    -- | Set the localised page title.
    --
    -- n.b. See comments for @setTitle@
    setTitleI :: (MonadWidget m, RenderMessage (HandlerSite m) msg) => msg -> m ()
    setTitleI :: forall (m :: * -> *) msg.
    (MonadWidget m, RenderMessage (HandlerSite m) msg) =>
    msg -> m ()
    setTitleI msg
    msg = do
        mr <- m (msg -> Text)
    forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    m (message -> Text)
    getMessageRender
        setTitle $ toHtml $ mr msg

    -- | Add description meta tag to the head of the page
    --
    -- Google does not use the description tag as a ranking signal, but the
    -- contents of this tag will likely affect your click-through rate since it
    -- shows up in search results.
    --
    -- The average length of the description shown in Google's search results is
    -- about 160 characters on desktop, and about 130 characters on mobile, at time
    -- of writing.
    --
    -- Source: https://www.advancedwebranking.com/blog/meta-tags-important-in-seo/
    --
    -- @since 1.6.18
    setDescription :: MonadWidget m => Text -> m ()
    setDescription :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    setDescription Text
    description =
        (RY (HandlerSite m) -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ HandlerSite m) =>
    (RY (HandlerSite m) -> Html) -> m ()
    toWidgetHead ((RY (HandlerSite m) -> Html) -> m ())
    -> (RY (HandlerSite m) -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ RY (HandlerSite m) -> Html
    [hamlet|<meta name=description content=#{description}>|]

    {-# WARNING setDescription
      [ "setDescription is not idempotent; we recommend setDescriptionIdemp instead"
      , "Multiple calls to setDescription will insert multiple meta tags in the page head."
      , "If you want an idempotent function, use setDescriptionIdemp - but if you do, you \
        \may need to change your layout to include pageDescription."
      ]
    #-}

    -- | Add translated description meta tag to the head of the page
    --
    -- n.b. See comments for @setDescription@.
    --
    -- @since 1.6.18
    setDescriptionI
      :: (MonadWidget m, RenderMessage (HandlerSite m) msg)
      => msg -> m ()
    setDescriptionI :: forall (m :: * -> *) msg.
    (MonadWidget m, RenderMessage (HandlerSite m) msg) =>
    msg -> m ()
    setDescriptionI msg
    msg = do
        mr <- m (msg -> Text)
    forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    m (message -> Text)
    getMessageRender
        toWidgetHead $ [hamlet|<meta name=description content=#{mr msg}>|]

    {-# WARNING setDescriptionI
      [ "setDescriptionI is not idempotent; we recommend setDescriptionIdempI instead"
      , "Multiple calls to setDescriptionI will insert multiple meta tags in the page head."
      , "If you want an idempotent function, use setDescriptionIdempI - but if you do, you \
        \may need to change your layout to include pageDescription."
      ]
    #-}

    -- | Add description meta tag to the head of the page
    --
    -- Google does not use the description tag as a ranking signal, but the
    -- contents of this tag will likely affect your click-through rate since it
    -- shows up in search results.
    --
    -- The average length of the description shown in Google's search results is
    -- about 160 characters on desktop, and about 130 characters on mobile, at time
    -- of writing.
    --
    -- Unlike 'setDescription', this version is *idempotent* - calling it multiple
    -- times will result in only a single description meta tag in the head.
    --
    -- Source: https://www.advancedwebranking.com/blog/meta-tags-important-in-seo/
    --
    -- @since 1.6.23
    setDescriptionIdemp :: MonadWidget m => Text -> m ()
    setDescriptionIdemp :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    setDescriptionIdemp Text
    description = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty (Maybe Description -> Last Description
    forall a. Maybe a -> Last a
    Last (Maybe Description -> Last Description)
    -> Maybe Description -> Last Description
    forall a b. (a -> b) -> a -> b
    $ Description -> Maybe Description
    forall a. a -> Maybe a
    Just (Description -> Maybe Description)
    -> Description -> Maybe Description
    forall a b. (a -> b) -> a -> b
    $ Text -> Description
    Description Text
    description) UniqueList (Script (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    -- | Add translated description meta tag to the head of the page
    --
    -- n.b. See comments for @setDescriptionIdemp@.
    --
    -- Unlike 'setDescriptionI', this version is *idempotent* - calling it multiple
    -- times will result in only a single description meta tag in the head.
    --
    -- @since 1.6.23
    setDescriptionIdempI
      :: (MonadWidget m, RenderMessage (HandlerSite m) msg)
      => msg -> m ()
    setDescriptionIdempI :: forall (m :: * -> *) msg.
    (MonadWidget m, RenderMessage (HandlerSite m) msg) =>
    msg -> m ()
    setDescriptionIdempI msg
    msg = do
        mr <- m (msg -> Text)
    forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    m (message -> Text)
    getMessageRender
        setDescriptionIdemp $ mr msg

    -- | Add OpenGraph type meta tag to the head of the page
    --
    -- See all available OG types here: https://ogp.me/#types
    --
    -- @since 1.6.18
    setOGType :: MonadWidget m => Text -> m ()
    setOGType :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    setOGType Text
    a = (RY (HandlerSite m) -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ HandlerSite m) =>
    (RY (HandlerSite m) -> Html) -> m ()
    toWidgetHead ((RY (HandlerSite m) -> Html) -> m ())
    -> (RY (HandlerSite m) -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ RY (HandlerSite m) -> Html
    [hamlet|<meta property="og:type" content=#{a}>|]

    -- | Add OpenGraph image meta tag to the head of the page
    --
    -- Best practices:
    --
    --    * Use custom images for shareable pages, e.g., homepage, articles, etc.
    --    * Use your logo or any other branded image for the rest of your pages.
    --    * Use images with a 1.91:1 ratio and minimum recommended dimensions of
    --      1200x630 for optimal clarity across all devices.
    --
    -- Source: https://ahrefs.com/blog/open-graph-meta-tags/
    --
    -- @since 1.6.18
    setOGImage :: MonadWidget m => Text -> m ()
    setOGImage :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    setOGImage Text
    a = (RY (HandlerSite m) -> Html) -> m ()
    forall site a (m :: * -> *).
    (ToWidgetHead site a, MonadWidget m, HandlerSite m ~ site) =>
    a -> m ()
    forall (m :: * -> *).
    (MonadWidget m, HandlerSite m ~ HandlerSite m) =>
    (RY (HandlerSite m) -> Html) -> m ()
    toWidgetHead ((RY (HandlerSite m) -> Html) -> m ())
    -> (RY (HandlerSite m) -> Html) -> m ()
    forall a b. (a -> b) -> a -> b
    $ RY (HandlerSite m) -> Html
    [hamlet|<meta property="og:image" content=#{a}>|]

    -- | Link to the specified local stylesheet.
    addStylesheet :: MonadWidget m => Route (HandlerSite m) -> m ()
    addStylesheet :: forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> m ()
    addStylesheet = (Route (HandlerSite m) -> [(Text, Text)] -> m ())
    -> [(Text, Text)] -> Route (HandlerSite m) -> m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Route (HandlerSite m) -> [(Text, Text)] -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> [(Text, Text)] -> m ()
    addStylesheetAttrs []

    -- | Link to the specified local stylesheet.
    addStylesheetAttrs :: MonadWidget m
                       => Route (HandlerSite m)
                       -> [(Text, Text)]
                       -> m ()
    addStylesheetAttrs :: forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> [(Text, Text)] -> m ()
    addStylesheetAttrs Route (HandlerSite m)
    x [(Text, Text)]
    y = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty (Stylesheet (Route (HandlerSite m))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    forall x. x -> UniqueList x
    toUnique (Stylesheet (Route (HandlerSite m))
     -> UniqueList (Stylesheet (Route (HandlerSite m))))
    -> Stylesheet (Route (HandlerSite m))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a b. (a -> b) -> a -> b
    $ Location (Route (HandlerSite m))
    -> [(Text, Text)] -> Stylesheet (Route (HandlerSite m))
    forall url. Location url -> [(Text, Text)] -> Stylesheet url
    Stylesheet (Route (HandlerSite m) -> Location (Route (HandlerSite m))
    forall url. url -> Location url
    Local Route (HandlerSite m)
    x) [(Text, Text)]
    y) Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    -- | Link to the specified remote stylesheet.
    addStylesheetRemote :: MonadWidget m => Text -> m ()
    addStylesheetRemote :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    addStylesheetRemote = (Text -> [(Text, Text)] -> m ()) -> [(Text, Text)] -> Text -> m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Text -> [(Text, Text)] -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Text -> [(Text, Text)] -> m ()
    addStylesheetRemoteAttrs []

    -- | Link to the specified remote stylesheet.
    addStylesheetRemoteAttrs :: MonadWidget m => Text -> [(Text, Text)] -> m ()
    addStylesheetRemoteAttrs :: forall (m :: * -> *).
    MonadWidget m =>
    Text -> [(Text, Text)] -> m ()
    addStylesheetRemoteAttrs Text
    x [(Text, Text)]
    y = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty UniqueList (Script (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty (Stylesheet (Route (HandlerSite m))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    forall x. x -> UniqueList x
    toUnique (Stylesheet (Route (HandlerSite m))
     -> UniqueList (Stylesheet (Route (HandlerSite m))))
    -> Stylesheet (Route (HandlerSite m))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a b. (a -> b) -> a -> b
    $ Location (Route (HandlerSite m))
    -> [(Text, Text)] -> Stylesheet (Route (HandlerSite m))
    forall url. Location url -> [(Text, Text)] -> Stylesheet url
    Stylesheet (Text -> Location (Route (HandlerSite m))
    forall url. Text -> Location url
    Remote Text
    x) [(Text, Text)]
    y) Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    addStylesheetEither :: MonadWidget m
                        => Either (Route (HandlerSite m)) Text
                        -> m ()
    addStylesheetEither :: forall (m :: * -> *).
    MonadWidget m =>
    Either (Route (HandlerSite m)) Text -> m ()
    addStylesheetEither = (Route (HandlerSite m) -> m ())
    -> (Text -> m ()) -> Either (Route (HandlerSite m)) Text -> m ()
    forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
    either Route (HandlerSite m) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> m ()
    addStylesheet Text -> m ()
    forall (m :: * -> *). MonadWidget m => Text -> m ()
    addStylesheetRemote

    addScriptEither :: MonadWidget m
                    => Either (Route (HandlerSite m)) Text
                    -> m ()
    addScriptEither :: forall (m :: * -> *).
    MonadWidget m =>
    Either (Route (HandlerSite m)) Text -> m ()
    addScriptEither = (Route (HandlerSite m) -> m ())
    -> (Text -> m ()) -> Either (Route (HandlerSite m)) Text -> m ()
    forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
    either Route (HandlerSite m) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> m ()
    addScript Text -> m ()
    forall (m :: * -> *). MonadWidget m => Text -> m ()
    addScriptRemote

    -- | Link to the specified local script.
    addScript :: MonadWidget m => Route (HandlerSite m) -> m ()
    addScript :: forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> m ()
    addScript = (Route (HandlerSite m) -> [(Text, Text)] -> m ())
    -> [(Text, Text)] -> Route (HandlerSite m) -> m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Route (HandlerSite m) -> [(Text, Text)] -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> [(Text, Text)] -> m ()
    addScriptAttrs []

    -- | Link to the specified local script.
    addScriptAttrs :: MonadWidget m => Route (HandlerSite m) -> [(Text, Text)] -> m ()
    addScriptAttrs :: forall (m :: * -> *).
    MonadWidget m =>
    Route (HandlerSite m) -> [(Text, Text)] -> m ()
    addScriptAttrs Route (HandlerSite m)
    x [(Text, Text)]
    y = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty (Script (Route (HandlerSite m))
    -> UniqueList (Script (Route (HandlerSite m)))
    forall x. x -> UniqueList x
    toUnique (Script (Route (HandlerSite m))
     -> UniqueList (Script (Route (HandlerSite m))))
    -> Script (Route (HandlerSite m))
    -> UniqueList (Script (Route (HandlerSite m)))
    forall a b. (a -> b) -> a -> b
    $ Location (Route (HandlerSite m))
    -> [(Text, Text)] -> Script (Route (HandlerSite m))
    forall url. Location url -> [(Text, Text)] -> Script url
    Script (Route (HandlerSite m) -> Location (Route (HandlerSite m))
    forall url. url -> Location url
    Local Route (HandlerSite m)
    x) [(Text, Text)]
    y) UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    -- | Link to the specified remote script.
    addScriptRemote :: MonadWidget m => Text -> m ()
    addScriptRemote :: forall (m :: * -> *). MonadWidget m => Text -> m ()
    addScriptRemote = (Text -> [(Text, Text)] -> m ()) -> [(Text, Text)] -> Text -> m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Text -> [(Text, Text)] -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    Text -> [(Text, Text)] -> m ()
    addScriptRemoteAttrs []

    -- | Link to the specified remote script.
    addScriptRemoteAttrs :: MonadWidget m => Text -> [(Text, Text)] -> m ()
    addScriptRemoteAttrs :: forall (m :: * -> *).
    MonadWidget m =>
    Text -> [(Text, Text)] -> m ()
    addScriptRemoteAttrs Text
    x [(Text, Text)]
    y = GWData (Route (HandlerSite m)) -> m ()
    forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell (GWData (Route (HandlerSite m)) -> m ())
    -> GWData (Route (HandlerSite m)) -> m ()
    forall a b. (a -> b) -> a -> b
    $ Body (Route (HandlerSite m))
    -> Last Title
    -> Last Description
    -> UniqueList (Script (Route (HandlerSite m)))
    -> UniqueList (Stylesheet (Route (HandlerSite m)))
    -> Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    -> Maybe (JavascriptUrl (Route (HandlerSite m)))
    -> Head (Route (HandlerSite m))
    -> GWData (Route (HandlerSite m))
    forall a.
    Body a
    -> Last Title
    -> Last Description
    -> UniqueList (Script a)
    -> UniqueList (Stylesheet a)
    -> Map (Maybe Text) (CssBuilderUrl a)
    -> Maybe (JavascriptUrl a)
    -> Head a
    -> GWData a
    GWData Body (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty Last Title
    forall a. Monoid a => a
    mempty Last Description
    forall a. Monoid a => a
    mempty (Script (Route (HandlerSite m))
    -> UniqueList (Script (Route (HandlerSite m)))
    forall x. x -> UniqueList x
    toUnique (Script (Route (HandlerSite m))
     -> UniqueList (Script (Route (HandlerSite m))))
    -> Script (Route (HandlerSite m))
    -> UniqueList (Script (Route (HandlerSite m)))
    forall a b. (a -> b) -> a -> b
    $ Location (Route (HandlerSite m))
    -> [(Text, Text)] -> Script (Route (HandlerSite m))
    forall url. Location url -> [(Text, Text)] -> Script url
    Script (Text -> Location (Route (HandlerSite m))
    forall url. Text -> Location url
    Remote Text
    x) [(Text, Text)]
    y) UniqueList (Stylesheet (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Map (Maybe Text) (CssBuilderUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Maybe (JavascriptUrl (Route (HandlerSite m)))
    forall a. Monoid a => a
    mempty Head (Route (HandlerSite m))
    forall a. Monoid a => a
    mempty

    whamlet :: QuasiQuoter
    whamlet :: QuasiQuoter
    whamlet = Q HamletRules -> HamletSettings -> QuasiQuoter
    NP.hamletWithSettings Q HamletRules
    rules HamletSettings
    NP.defaultHamletSettings

    whamletFile :: FilePath -> Q Exp
    whamletFile :: String -> Q Exp
    whamletFile = Q HamletRules -> HamletSettings -> String -> Q Exp
    NP.hamletFileWithSettings Q HamletRules
    rules HamletSettings
    NP.defaultHamletSettings

    whamletFileWithSettings :: NP.HamletSettings -> FilePath -> Q Exp
    whamletFileWithSettings :: HamletSettings -> String -> Q Exp
    whamletFileWithSettings = Q HamletRules -> HamletSettings -> String -> Q Exp
    NP.hamletFileWithSettings Q HamletRules
    rules

    asWidgetT :: WidgetT site m () -> WidgetT site m ()
    asWidgetT :: forall site (m :: * -> *). WidgetT site m () -> WidgetT site m ()
    asWidgetT = WidgetT site m () -> WidgetT site m ()
    forall a. a -> a
    id

    rules :: Q NP.HamletRules
    rules :: Q HamletRules
    rules = do
        ah <- [|asWidgetT . toWidget|]
        let helper m Exp
    qg Exp -> m Exp
    f = do
                x <- String -> m Name
    forall (m :: * -> *). Quote m => String -> m Name
    newName String
    "urender"
                e <- f $ VarE x
                let e' = [Pat] -> Exp -> Exp
    LamE [Name -> Pat
    VarP Name
    x] Exp
    e
                g <- qg
                bind <- [|(>>=)|]
                return $ InfixE (Just g) bind (Just e')
        let ur Env -> t
    f = do
                let env :: Env
    env = Maybe ((Exp -> Q Exp) -> Q Exp)
    -> Maybe ((Exp -> Q Exp) -> Q Exp) -> Env
    NP.Env
                        (((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp)
    forall a. a -> Maybe a
    Just (((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp))
    -> ((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp)
    forall a b. (a -> b) -> a -> b
    $ Q Exp -> (Exp -> Q Exp) -> Q Exp
    forall {m :: * -> *}. Quote m => m Exp -> (Exp -> m Exp) -> m Exp
    helper [|getUrlRenderParams|])
                        (((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp)
    forall a. a -> Maybe a
    Just (((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp))
    -> ((Exp -> Q Exp) -> Q Exp) -> Maybe ((Exp -> Q Exp) -> Q Exp)
    forall a b. (a -> b) -> a -> b
    $ Q Exp -> (Exp -> Q Exp) -> Q Exp
    forall {m :: * -> *}. Quote m => m Exp -> (Exp -> m Exp) -> m Exp
    helper [|fmap (toHtml .) getMessageRender|])
                Env -> t
    f Env
    env
        return $ NP.HamletRules ah ur $ \Env
    _ Exp
    b -> Exp -> Q Exp
    forall a. a -> Q a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Exp -> Q Exp) -> Exp -> Q Exp
    forall a b. (a -> b) -> a -> b
    $ Exp
    ah Exp -> Exp -> Exp
    `AppE` Exp
    b

    -- | Wraps the 'Content' generated by 'hamletToContent' in a 'RepHtml'.
    ihamletToRepHtml :: (MonadHandler m, RenderMessage (HandlerSite m) message)
                     => HtmlUrlI18n message (Route (HandlerSite m))
                     -> m Html
    ihamletToRepHtml :: forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    HtmlUrlI18n message (Route (HandlerSite m)) -> m Html
    ihamletToRepHtml = HtmlUrlI18n message (Route (HandlerSite m)) -> m Html
    forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    HtmlUrlI18n message (Route (HandlerSite m)) -> m Html
    ihamletToHtml
    {-# DEPRECATED ihamletToRepHtml "Please use ihamletToHtml instead" #-}

    -- | Wraps the 'Content' generated by 'hamletToContent' in a 'RepHtml'.
    --
    -- Since 1.2.1
    ihamletToHtml :: (MonadHandler m, RenderMessage (HandlerSite m) message)
                  => HtmlUrlI18n message (Route (HandlerSite m))
                  -> m Html
    ihamletToHtml :: forall (m :: * -> *) message.
    (MonadHandler m, RenderMessage (HandlerSite m) message) =>
    HtmlUrlI18n message (Route (HandlerSite m)) -> m Html
    ihamletToHtml HtmlUrlI18n message (Route (HandlerSite m))
    ih = do
        urender <- m (Route (HandlerSite m) -> [(Text, Text)] -> Text)
    forall (m :: * -> *).
    MonadHandler m =>
    m (Route (HandlerSite m) -> [(Text, Text)] -> Text)
    getUrlRenderParams
        mrender <- getMessageRender
        return $ ih (toHtml . mrender) urender

    tell :: MonadWidget m => GWData (Route (HandlerSite m)) -> m ()
    tell :: forall (m :: * -> *).
    MonadWidget m =>
    GWData (Route (HandlerSite m)) -> m ()
    tell = WidgetFor (HandlerSite m) () -> m ()
    forall a. WidgetFor (HandlerSite m) a -> m a
    forall (m :: * -> *) a.
    MonadWidget m =>
    WidgetFor (HandlerSite m) a -> m a
    liftWidget (WidgetFor (HandlerSite m) () -> m ())
    -> (GWData (Route (HandlerSite m)) -> WidgetFor (HandlerSite m) ())
    -> GWData (Route (HandlerSite m))
    -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . GWData (Route (HandlerSite m)) -> WidgetFor (HandlerSite m) ()
    forall site. GWData (Route site) -> WidgetFor site ()
    tellWidget

    toUnique :: x -> UniqueList x
    toUnique :: forall x. x -> UniqueList x
    toUnique = ([x] -> [x]) -> UniqueList x
    forall x. ([x] -> [x]) -> UniqueList x
    UniqueList (([x] -> [x]) -> UniqueList x)
    -> (x -> [x] -> [x]) -> x -> UniqueList x
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (:)

    handlerToWidget :: HandlerFor site a -> WidgetFor site a
    handlerToWidget :: forall site a. HandlerFor site a -> WidgetFor site a
    handlerToWidget (HandlerFor HandlerData site site -> IO a
    f) = (WidgetData site -> IO a) -> WidgetFor site a
    forall site a. (WidgetData site -> IO a) -> WidgetFor site a
    WidgetFor ((WidgetData site -> IO a) -> WidgetFor site a)
    -> (WidgetData site -> IO a) -> WidgetFor site a
    forall a b. (a -> b) -> a -> b
    $ HandlerData site site -> IO a
    f (HandlerData site site -> IO a)
    -> (WidgetData site -> HandlerData site site)
    -> WidgetData site
    -> IO a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . WidgetData site -> HandlerData site site
    forall site. WidgetData site -> HandlerData site site
    wdHandler