[Haskell] [Haskell-cafe] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4
John Meacham
john at repetae.net
Thu Feb 16 22:28:59 CET 2012
On Thu, Feb 16, 2012 at 1:20 PM, Ian Lynagh <igloo at earth.li> wrote:
> I've now implemented this in GHC. For now, the syntax is:
>
> type {-# CTYPE "some C type" #-} Foo = ...
> newtype {-# CTYPE "some C type" #-} Foo = ...
> data {-# CTYPE "some C type" #-} Foo = ...
>
> The magic for (Ptr a) is built in to the compiler.
Heh. I just added it for jhc too with the exact same syntax. :)
the difference is that I do not allow them for 'type' declarations, as
dusugaring of types happens very early in compilation, and it feels sort
of wrong to give type synonyms meaning. like I'm breaking referential
transparency or something..
I also allow foreign header declarations just like with ccall.
data {-# CTYPE "stdio.h FILE" #-} CFile
will mean that 'stdio.h' needs to be included for FILE to be declared.
John
More information about the Haskell
mailing list