
Hi,
This package is to be used with hsc2hs. (hsc2hs is called
automatically if you use Cabal.) It's a self-contained set of
macros used to create a Haskell wrap for a C interface. They
follow the idea that it's better to have a C-like wrap code
first and then write Haskell-like code on top of that than going
directly from C to Haskell style.
Hackage link: http://hackage.haskell.org/package/bindings-DSL
Wiki documentation: http://bitbucket.org/mauricio/bindings-dsl
The fancy 'domain specific language' comes from 'binding-SDL'
macros hability to describe a C interface. Instead of writing
Haskell or preprocessor code, you can use 'bindings-DSL' macros
to describe the interface you want to wrap without knowledge of
how that description translates to preprocessor or Haskell code.
Suppose, for instance, you have the following C struct:
struct example_struct{
int n;
struct example_struct *p;
}
It will be described like this:
#starttype struct example_struct
#field n , CInt
#field p , Ptr