Skip to content

Instantly share code, notes, and snippets.

@justinwhite
justinwhite / Example.hs
Created December 10, 2015 22:17 — forked from charles-cooper/Example.hs
RFC: dsl for writing C
import Language.C.DSL
import Language.Format
main = prettyPrint $ do
include "stdio.h"
includeLocal "foo.h"
intptr_t <- typedef (ptr int) "intptr_t"
x <- int "x"
y <- double "y"
z <- ptr intptr_t "z"
w <- carray int "w" 21