Re: Ptr and ForeignPtr Questions

At 2001-09-23 04:02, Manuel M. T. Chakravarty wrote:
I would assume that Ptr types would always be mapped to non-const pointers. Do you have an example of a Haskell type for a foreign import function, for which the corresponding C function type would be ambiguous?
Take, for example, the following excerpt of the Linux man pages
But do you have an example of a Haskell type for a foreign import function, for which the corresponding C function type would be ambiguous? At 2001-09-21 02:20, Manuel M. T. Chakravarty wrote:
One could attempt to generate C prototypes from the Haskell type declarations or similar things, btu it doesn't work out.
Surely one can still do this? This was what we were discussing, was it not? A C type for any given Haskell function type, not necessarily the other way around... -- Ashley Yakeley, Seattle WA

Ashley Yakeley
At 2001-09-23 04:02, Manuel M. T. Chakravarty wrote:
I would assume that Ptr types would always be mapped to non-const pointers. Do you have an example of a Haskell type for a foreign import function, for which the corresponding C function type would be ambiguous?
Take, for example, the following excerpt of the Linux man pages
But do you have an example of a Haskell type for a foreign import function, for which the corresponding C function type would be ambiguous?
Hmm, we must be misunderstanding each other. Given that you have foreign import strcat :: Ptr CChar -> Ptr CChar -> IO (Ptr CChar) How do you want to know whether the C prototype is char *strcat(char *dest, const char *src); or char *strcat(char *dest, char *src); ? Manuel
participants (2)
-
Ashley Yakeley
-
Manuel M. T. Chakravarty