new ForeignPtr without finalizers

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Thu Jun 12 04:02:04 EDT 2003


Manuel:
> In other words, it seem much more likely that one would
> partially apply `newForeignPtr' to a finaliser than to a
> pointer that is to be finalised.  But this is a minor point.

Having written some more ffi code over the last couple of days, I agree that 
this is much more natural so, even though it will break all the packages I 
released in the last week, I now vote for swapping the argument order.

Since this breaks code anyway, we could adopt Dean's proposal to allow lists 
of arguments to newFP and addFPFinalizers without making things worse.  I 
don't think we should do this though since I believe they would always be 
used with singleton or empty arguments and because the list-based versions 
can be trivially added with a foldM if they prove useful.

--
Alastair Reid



More information about the FFI mailing list