Legend:

Implementation is trivial once you can parse the new constructs (purposfully similar to existing haskell constructs so lexer and parser need not be modified other than to add new rule). these declarations translate immediatly into equivalant C, C--, or assembly linker directives.

41

42

43

== caveats ==

44

45

It is anoying that <n> must be a constant and <type> must be a builtin, but there is not really any other recourse without defining a preprocessor in haskell or a staged system like template haskell. however, use of CPP or a preprocessor like hsc2hs will mitigate these problems and the situation is no worse (and somewhat better) than when having to link against an external C library.

46

47

A possible extension would be to allow implementations to derive instances of Storable and allow types with such derived instances be used in foreign space declarations too.