On Thursday 29 May 2003 11:18, Adrian Hey wrote: > I don't see any significant difference between proper > treatment of pointers and proper treatment of IORefs. For example > functions of type.. > IORef a -> [IORef a] -> [IORef a] > are perfectly ok, despite the fact that they can't do anything > (I.E read or write) with their IORefs.
Whoops, now I see a real problem with what I'm asking for. I guess since the (hypothetical) withCString is creating a new CString (bit like an IORef) it should have type withCString :: String -> (CString -> b) -> IO b and I guess my <+ should be.. (<+) :: (a -> b) -> ((a -> IO b) -> IO b) -> IO b f <+ alloc = alloc $ \p -> return $ f p (Well at least that's got rid of the unsafePerformIO :-) Would this be safe? Regards -- Adrian Hey _______________________________________________ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi