hsx-jmacro-7.3.8: hsp+jmacro support

Safe HaskellNone
LanguageHaskell98

HSP.JMacroT

Description

This experimental module provides a monad transformer JMacroT and corresponding XMLGenerator instance which can be used to directly generate javascript which builds an XML/HTML DOM.

This is similar to the 'ToJExpr XMLToDOM' instance except that there is no intermediate XML type. The XMLGenerator instance directly generates the javascript needed to build the DOM.

This is intellectually fun. But it is not clear how it is valuable. That is why this module is marked as experimental.

Synopsis

Documentation

newtype JMacroT m a Source #

isomorphic to IdentityT, but used for generating javascript that generates XML/HTML

Constructors

JMacroT 

Fields

Instances

MonadTrans JMacroT Source # 

Methods

lift :: Monad m => m a -> JMacroT m a #

MonadRWS r w s m => MonadRWS r w s (JMacroT m) Source # 
MonadError e m => MonadError e (JMacroT m) Source # 

Methods

throwError :: e -> JMacroT m a #

catchError :: JMacroT m a -> (e -> JMacroT m a) -> JMacroT m a #

MonadReader r m => MonadReader r (JMacroT m) Source # 

Methods

ask :: JMacroT m r #

local :: (r -> r) -> JMacroT m a -> JMacroT m a #

reader :: (r -> a) -> JMacroT m a #

MonadState s m => MonadState s (JMacroT m) Source # 

Methods

get :: JMacroT m s #

put :: s -> JMacroT m () #

state :: (s -> (a, s)) -> JMacroT m a #

MonadWriter w m => MonadWriter w (JMacroT m) Source # 

Methods

writer :: (a, w) -> JMacroT m a #

tell :: w -> JMacroT m () #

listen :: JMacroT m a -> JMacroT m (a, w) #

pass :: JMacroT m (a, w -> w) -> JMacroT m a #

Monad m => Monad (JMacroT m) Source # 

Methods

(>>=) :: JMacroT m a -> (a -> JMacroT m b) -> JMacroT m b #

(>>) :: JMacroT m a -> JMacroT m b -> JMacroT m b #

return :: a -> JMacroT m a #

fail :: String -> JMacroT m a #

Functor m => Functor (JMacroT m) Source # 

Methods

fmap :: (a -> b) -> JMacroT m a -> JMacroT m b #

(<$) :: a -> JMacroT m b -> JMacroT m a #

Applicative m => Applicative (JMacroT m) Source # 

Methods

pure :: a -> JMacroT m a #

(<*>) :: JMacroT m (a -> b) -> JMacroT m a -> JMacroT m b #

(*>) :: JMacroT m a -> JMacroT m b -> JMacroT m b #

(<*) :: JMacroT m a -> JMacroT m b -> JMacroT m a #

Alternative m => Alternative (JMacroT m) Source # 

Methods

empty :: JMacroT m a #

(<|>) :: JMacroT m a -> JMacroT m a -> JMacroT m a #

some :: JMacroT m a -> JMacroT m [a] #

many :: JMacroT m a -> JMacroT m [a] #

MonadPlus m => MonadPlus (JMacroT m) Source # 

Methods

mzero :: JMacroT m a #

mplus :: JMacroT m a -> JMacroT m a -> JMacroT m a #

MonadIO m => MonadIO (JMacroT m) Source # 

Methods

liftIO :: IO a -> JMacroT m a #

(Functor m, Monad m) => XMLGen (JMacroT m) Source # 

Associated Types

type XMLType (JMacroT m :: * -> *) :: * #

type StringType (JMacroT m :: * -> *) :: * #

data ChildType (JMacroT m :: * -> *) :: * #

data AttributeType (JMacroT m :: * -> *) :: * #

(Functor m, Monad m, (~) * (StringType (JMacroT m)) Text) => XMLGenerator (JMacroT m) Source # 
MonadCont m => MonadCont (JMacroT m) Source # 

Methods

callCC :: ((a -> JMacroT m b) -> JMacroT m a) -> JMacroT m a #

(Functor m, Monad m) => EmbedAsChild (JMacroT m) () Source # 

Methods

asChild :: () -> GenChildList (JMacroT m) #

(Functor m, Monad m) => EmbedAsChild (JMacroT m) Text Source # 

Methods

asChild :: Text -> GenChildList (JMacroT m) #

(Functor m, Monad m) => EmbedAsChild (JMacroT m) Text Source # 

Methods

asChild :: Text -> GenChildList (JMacroT m) #

(Functor m, Monad m, (~) * (StringType (JMacroT m)) Text) => EmbedAsChild (JMacroT m) String Source # 
(Functor m, Monad m, (~) * (StringType (JMacroT m)) Text) => EmbedAsChild (JMacroT m) Char Source # 

Methods

asChild :: Char -> GenChildList (JMacroT m) #

(Functor m, Monad m) => SetAttr (JMacroT m) JExpr Source # 
(Functor m, Monad m) => AppendChild (JMacroT m) JExpr Source # 
(Functor m, Monad m) => EmbedAsAttr (JMacroT m) (Attr Text Int) Source # 
(Functor m, Monad m) => EmbedAsAttr (JMacroT m) (Attr Text Bool) Source # 
(Functor m, Monad m) => EmbedAsAttr (JMacroT m) (Attr Text Text) Source # 
ToJExpr a => ToJExpr (XMLGenT JMacroM a) Source # 
data AttributeType (JMacroT m) Source # 
data ChildType (JMacroT m) Source # 
type StringType (JMacroT m) Source # 
type XMLType (JMacroT m) Source # 
type XMLType (JMacroT m) = JExpr

evalJMacroT :: XMLGenT (JMacroT m) JExpr -> m JExpr Source #

unwrap the XMLGenT and JMacroT constructors

mapJMacroT :: (m a -> n b) -> JMacroT m a -> JMacroT n b Source #

map a function over the inner monad

type JMacroM = JMacroT Identity Source #

an alias for 'JMacroT Identity'