[commit: ghc] master: Implement the CTYPE pragma; part of the CApiFFI extension (546dd4f)
Simon Marlow
marlowsd at gmail.com
Fri Feb 17 10:27:22 CET 2012
On 16/02/2012 20:56, Ian Lynagh wrote:
> Repository : ssh://darcs.haskell.org//srv/darcs/ghc
>
> On branch : master
>
> http://hackage.haskell.org/trac/ghc/changeset/546dd4f219ba05880e252e7fee6a2037a50ed3b3
>
>> ---------------------------------------------------------------
>
> commit 546dd4f219ba05880e252e7fee6a2037a50ed3b3
> Author: Ian Lynagh<igloo at earth.li>
> Date: Wed Feb 15 14:55:23 2012 +0000
>
> Implement the CTYPE pragma; part of the CApiFFI extension
>
> For now, the syntax is
> type {-# CTYPE "some C type" #-} Foo = ...
> newtype {-# CTYPE "some C type" #-} Foo = ...
> data {-# CTYPE "some C type" #-} Foo = ...
Don't we now have a problem with needing header files to define these
types? What if a module in another package uses one of these types in a
foreign import capi?
Also, attaching C types to type synonyms seems a bit fragile - type
synonyms are ephemeral things, and I'm worried the type annotation could
easily get lost.
Cheers,
Simon
More information about the Cvs-ghc
mailing list