-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Support for using JMacro with Happstack
--   
--   JMacro provides QuasiQuote support for embedding javascript in Haskell
--   source. This module provides some helper functions for serving the
--   generated javascript via Happstack
@package happstack-jmacro
@version 7.0.12.6


-- | This modules provides support for using JMacro with Happstack.
--   
--   It provides the instance,
--   
--   <pre>
--   instance ToMessage JStat
--   </pre>
--   
--   Which will serve a <a>JStat</a> value as <tt>text/javascript;
--   charset=UTF-8</tt>. The rendered JavaScript will be wrapped in an
--   anonymous function that is then called, so as to ensure the statements
--   execute in a local scope. An implication of this is that top-level
--   unhygienic variables in JMacro will <i>not</i> be globally available;
--   instead, you should set properties on the global <tt>window</tt>
--   object.
module Happstack.Server.JMacro

-- | Render a <a>JStat</a> into a <a>Response</a>, saturating the variable
--   names with a hash computed from the <a>rqUri</a>. Unlike the
--   <a>ToMessage</a> instance for <tt>JStat</tt>, this doesn't wrap the
--   statements in a function and so the workaround for global unhygienic
--   names isn't necessary. On the other hand, generated variable names are
--   a bit longer.
jmResponse :: ServerMonad m => JStat -> m Response
instance Happstack.Server.Response.ToMessage Happstack.Server.JMacro.PrefixedJStat
instance Happstack.Server.Response.ToMessage Language.Javascript.JMacro.Base.JStat
