| ... | ... | @@ -46,3 +46,11 @@ a "string" to be interpreted as utf8 or unicode code points depending on what ty |
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
## caveats
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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. |