John Meacham john at
Mon Oct 14 17:21:58 EDT 2002

I dont have cvs write access but you should mention something about
expressing gc dependencies between ForeignPtr's. the only two ways to do
this in the current haskell systems are
* weak pointers
* touchForeignPtr from the finalizer of another ForeignPtr

if the second one is not allowed by restricting us to C only finalizers,
then the first needs to be added into the FFI, (or some other mechanism
invented). I consider this functionality vital for any non-trivial use
of ForeignPtr, and it becomes more important as we move more stuff to C
land, as C structures become more common.

for more info on the use of this, see the FFI touchForeignPtr
documentation and the paper describing Weak pointers in ghc. the fact
that multiple people saw the need for this and came up with solutions
probably says something about its usefulness. 

On Mon, Oct 14, 2002 at 06:16:05PM +0100, Simon Marlow wrote:
> > Thanks to everyone who has contributed to this discussion so 
> > far.  Since
> > there are a lot of subtle points to be considered at once, I 
> > thought I'd
> > try to write a summary of the issues raised so far.
> > 
> > I'll put something in the repository so we can all hack on it.
> > Hopefully I'll have something ready later today.
> oops, I should have mentioned that if you just want to read the
> document, it will be available here:
> txt
> just as soon as the CVS web server updates its repository.
> Cheers,
> 	Simon
> _______________________________________________
> FFI mailing list
> FFI at

John Meacham - California Institute of Technology, Alum. - john at

More information about the FFI mailing list