On Mon, Jul 12, 2010 at 11:57:18AM +0100, Simon Marlow wrote:
On 09/07/2010 18:46, John Meacham wrote:
On Fri, Jul 09, 2010 at 12:39:38PM +0100, Simon Marlow wrote:
On 08/07/2010 22:46, John Meacham wrote:
Ack, I just noticed that IntPtr,IntMax, and WordPtr and WordMax were left out of the report. These are fairly vital for writing portable FFI code.
Make a proposal to get them into Haskell 2011, I don't imagine it would be controversial.
That's the thing, They were already accepted as part of H'2010. At least according to the site:
http://hackage.haskell.org/trac/haskell-prime/wiki/ForeignFunctionInterface
Ok, this is probably an oversight on my part, so sorry about that. I can treat it as errata and fix the report.
However I'm a bit confused. Currently we have IntPtr and WordPtr exported by Foreign.Ptr in base, but we don't have IntMax and WordMax anywhere that I can see, and I don't recall any discussion about where they should be defined, or what they should be defined to.
Hmm... It appears there was some divergence between my initial proposal, what jhc implemented, and what ghc implemented. Is there any issue with declaring that IntPtr and WordPtr marshal to intptr_t and uintptr_t respectively? If not, then just having those in Foreign.Ptr like ghc does seems fine. In jhc I export them from Data.Word and Data.Int respectively, but I will change it to match ghc/the report. I do think IntMax and WordMax are quite useful as haskell types and should be in Data.Int and Data.Word, but if we have CIntMax and CWordMax then they arn't strictly neccesary from a FFI standpoint. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/