fixing Foreign

John Meacham john at repetae.net
Fri Dec 15 16:52:04 EST 2006


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⑈


More information about the Libraries mailing list