[Haskell-cafe] Re: Mixing C and Haskell code in the same file

Maurí­cio briqueabraque at yahoo.com
Wed Jul 15 20:09:28 EDT 2009


> #def inline int signof(int x) {return x<0?-1:x>0?1:0;}
> foreign import ccall safe ""
>   signof :: CInt -> CInt

Is it possible to get that #def as a result of
a macro? Say, something like this:

---

(WARNING: invalid code)

#define ret(name,value,type) \
   #def inline type name (void) {return value;}

---

Thanks,
Maurício



More information about the Haskell-Cafe mailing list