On Fri, Feb 17, 2012 at 09:27:22AM +0000, Simon Marlow wrote:
>
> 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?
Fixed, and test added; thanks.
> 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.
Well, it's pretty robust. These are types explicitly written in
signatures on FFI decls, not types that we are going to be inferring.
I think you could reasonably want to attach a C type to a type synonym,
e.g. when using hsc2hs you might want to do something like
type {-# CTYPE "unistd.h" "useconds_t" #-}
CUSeconds = #type useconds_t
(we use a newtype for CUSeconds, but it wouldn't be unreasonable for
someone to want to use a type synonym in an analogous case).
Thanks
Ian
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc