ForeignPtr
Ross Paterson
ross at soi.city.ac.uk
Thu Nov 7 12:05:17 EST 2002
On Thu, Nov 07, 2002 at 04:53:04PM +0000, Alastair Reid wrote:
>
> >> On first glance, this looks cool. What instances do you envision
> >> (assuming I persuaded you that StablePtr and FunPtr should not be)?
>
> > How about Int (for file descriptors, etc)?
>
> Ah, got you.
>
> How about making ForeignPtr slightly more polymorphic so that instead of
> working only on 'Ptr a' it works on 'a'.
That was Ashley's original proposal, but SimonM responded in
http://www.haskell.org/pipermail/glasgow-haskell-users/2001-September/002290.html
http://www.haskell.org/pipermail/glasgow-haskell-users/2001-September/002304.html
that the extra boxing was unsafe in GHC. Hence the Finalizable class
for boxed primitive objects, similar to the way UArray's are presented
without exposing GHC's unboxed types.
More information about the FFI
mailing list