
I was thinking that we should consider fixing some issues with the current Foreign library before haskell' when it comes to support for 64-bit (and non 32-bit in general) architectures. the specific changes I am thinking of are mandate IntPtr,WordPtr,IntMax,and WordMax as defined by the C99 types intptr_t, uintptr_t, intmax_t, and uintmax_t. (these are all supported by jhc and ghc right now) change the following type signatures bitSize :: Bits a => a -> Maybe Int (to handle Integer and similar types properly) plusPtr :: Ptr a -> IntPtr -> Ptr a minusPtr :: Ptr a -> Ptr b -> IntPtr add the following ptrToIntPtr :: Ptr a -> IntPtr intPtrToPtr :: IntPtr -> Ptr a ptrToWordPtr :: Ptr a -> WordPtr wordPtrToPtr :: WordPtr -> Ptr a Also, we should make sure whatever new IO interface for files we come up with is 64 bit safe when it comes to offsets inside of files. Int64,IntMax, or some new Offset type are all candidates. John -- John Meacham - ⑆repetae.net⑆john⑈

On Fri, Dec 15, 2006 at 04:45:51PM -0600, Taral wrote:
On 12/15/06, John Meacham
wrote: plusPtr :: Ptr a -> IntPtr -> Ptr a minusPtr :: Ptr a -> Ptr b -> IntPtr
This is ptrdiff_t, if I recall correctly...
indeed. C's 'typedef's are like haskell 'type's though and are more for documentation than anything in many cases. For haskell we don't want to go and create distinct haskell types for everything, IntPtr is perfect for this task. :) John -- John Meacham - ⑆repetae.net⑆john⑈
participants (2)
-
John Meacham
-
Taral