HJScript-0.7.0: HJScript is a Haskell EDSL for writing JavaScript programs.

LicenseBSD-style
MaintainerJoel Bjornson joel.bjornson@gmail.com Niklas Broberg nibro@cs.chalmers.se
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

HJScript

Contents

Description

 

Synopsis

Data types and classes

type HJScript' = StateT HJState (Writer (Block ())) Source

HJScript Monad

class IsHJScript a where Source

IsHJscript class with function toHJScript for converting instances to HJScript ()

Methods

toHJScript :: a -> HJScript () Source

Functions

evalHJScript :: HJScript t -> (t, Block ()) Source

Evaluate a script returning a tuple of the produced value and a block of code.

runHJScript :: HJScript t -> HJState -> (t, HJState, Block ()) Source

Runs a script returning the value, the new state and the block of code.

outputBlock :: Block () -> HJScript () Source

Adds a block

outputStmt :: Stmt () -> HJScript () Source

Adds a statement

hjsInside :: HJScript t -> HJScript (t, Block ()) Source

Runs one script inside another