Since CPP mode removes newlines in the out macro expansion. It appears
to be impossible to have a macro expand to a function with an INLINE
pragma since it appears to need to be in its own line.

For example:

#define GETHOSTWORD(name, m, type) \
{-# INLINE name #-} \
name :: m type ; \
name = getPtr (sizeOf (undefined :: type)) \

Does work (since you can't follow the INLINE pragma with anything else
on the same line.

Likewise:

#define GETHOSTWORD(name, m, type) \
name :: m type ; \
name = getPtr (sizeOf (undefined :: type)) \
{-# INLINE name #-}

Also doesn't work since the INLINE needs to start at the beginning of a line.

Has anyone a workaround for this, or a way to get the preprocessor to
output a newline?


Cheers

AGL

-- 
Adam Langley                                      [EMAIL PROTECTED]
http://www.imperialviolet.org                       650-283-9641
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to