Ptr and ForeignPtr Questions

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Mon, 24 Sep 2001 12:14:25 +1000


Ashley Yakeley <ashley@semantic.org> wrote,

> 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