c-dsl-0.3.1: A higher level DSL on top of language-c

Safe HaskellNone

Language.C.DSL.Stat

Synopsis

Documentation

cif :: CExpr -> CStat -> CStatSource

An if statement with no else clause

cifElse :: CExpr -> CStat -> CStat -> CStatSource

An if statement with an else clause

while :: CExpr -> CStat -> CStatSource

A while loop, the CExpr is the looping condition.

for :: (CDecl, CExpr, CExpr) -> CStat -> CStatSource

A for loop, an example use

 for(int "x" .= 1, 1, PlusPlus `pre` "x")
   "printf"#[str "%d\n", "x"]

noDeclFor :: (CExpr, CExpr) -> CStat -> CStatSource

A for loop with no declarations.

doWhile :: CExpr -> CStat -> CStatSource

A do while loop.