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

Safe HaskellNone
LanguageHaskell2010

Language.C.DSL.Stat

Synopsis

Documentation

cif :: CExpr -> CStat -> CStat Source

An if statement with no else clause

cifElse :: CExpr -> CStat -> CStat -> CStat Source

An if statement with an else clause

while :: CExpr -> CStat -> CStat Source

A while loop, the CExpr is the looping condition.

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

A for loop, an example use

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

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

A for loop with no declarations.

doWhile :: CExpr -> CStat -> CStat Source

A do while loop.

hBlock :: BlockLike a => [a] -> CStat Source