<HTML><BODY>Hello haskellers,<br><br>I'm writing FFI bindings to C library which uses some allocations across functions call, for example:<br><br>int *alloc_buf(void);<br>void free_buf(int *);<br><br>So I need to use newForeignPtr to make sure buffer will be free'd when all pointers to it get collected.<br>But what if I want to do this in PrimMonad (say, ST) and not IO (returned by newForeignPtr)?<br><br>Thanks.</BODY></HTML>