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

Stabilityexperimental
MaintainerJoel Bjornson joel.bjornson@gmail.com Niklas Broberg nibro@cs.chalmers.se

HJScript

Contents

Description

 

Synopsis

Data types and classes

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

HJScript Monad

class IsHJScript a whereSource

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

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