blazeMarker-0.1.0.0: ...

Safe HaskellNone
LanguageHaskell2010

Control.Monad.FreeMarker

Description

Following the shell monad ( http:/hackage.haskell.orgpackageshell-monad ) the ASM monad ( http:wall.org~lewis20131015asm-monad.html ) and the brainfuck monad ( http:/hackage.haskell.orgpackage/brainfuck-monad ) here is a very experimental FreeMarker monad.

Example use:

test = FM.renderFM $ do
    bar <- FM.dec $ FM.litS "string blablabla"
    lol <- FM.und "varName" $ FM.litN 123
    FM.exlitl
    FM.litH $ do
        B5.div $ do
            R$<< bar
            th "test2"
    FM.lit "test"
    foo <- FM.dec $ FM.true
    FM.ifel (foo =~ FM.false)
        (do
            FM.litH $ do
                B5.div $ do
                    th "ok true div"
        )
        (FM.lit "false")
    FM.list ( FM.litL $ litN 123 >: litN 321 >: [] ) $ \vi -> do
        D$< vi
    FM.list ( FM.litNL [12,321,32] ) $ \vi -> do
        D$< vi

Documentation

litH :: Html -> FM () Source

data FM a Source

Constructors

FM (VarCounter -> (String, VarCounter, a)) 

data FEX a b Source

Constructors

FEX String 

Instances

Show (FEX a b) 

data EList a Source

data E Source

usF :: String -> FEX a b -> FEX c d Source

usM :: FEX a b -> String -> FEX c d Source

(>~) :: FEX a b -> FEX c b -> FEX E EBool Source

(>=~) :: FEX a b -> FEX c b -> FEX E EBool Source

(<~) :: FEX a b -> FEX c b -> FEX E EBool Source

(<=~) :: FEX a b -> FEX c b -> FEX E EBool Source

(=~) :: FEX a b -> FEX c b -> FEX E EBool Source

lit :: String -> FM () Source

lite :: String -> FEX a b Source

size :: FEX a (EList b) -> FEX E ENum Source

data LC b Source

Constructors

forall a . LC (FEX a b) 

Instances

Show (LC b) 

type LitLET a = FEX E (EList a) Source

litL :: [LC b] -> FEX E (EList b) Source

litNL :: (Num a, Show a) => [a] -> FEX E (EList ENum) Source

(>:) :: FEX a b -> [LC b] -> [LC b] infixr 1 Source

list :: FEX a (EList lt) -> (FEX EName lt -> FM b) -> FM () Source

if_ :: FEX a EBool -> FM b -> FM () Source

ifel :: FEX a EBool -> FM b -> FM c -> FM () Source

dec :: FEX a b -> FM (FEX EName b) Source

namedDec :: String -> FEX a b -> FM (FEX EName b) Source

und :: String -> FEX a b -> FM (FEX EName b) Source

assign :: FEX EName a -> FEX b a -> FM () Source

def :: FEX a b -> FEX a b -> FEX a b Source

data D Source

Constructors

D 

data R Source

Constructors

R 

($<) :: D -> FEX a b -> FM () Source

($<<) :: R -> FEX a b -> Html Source

litN :: (Show a, Num a) => a -> FEX E ENum Source

test :: FM () Source