Dear foreigners

Simon and I noticed this morning that ForeignObj should
really be parameterised.  The current type of newForeignObj is

  newForeignObj :: Ptr a -> IO () -> IO ForeignObj

This immediately loses the type information on the Ptr!
Shouldn't it be

  newForeignObj :: Ptr a -> IO () -> IO (ForeignObj a)

Or maybe we should shorten it to (FPtr a)?  ("F" for "finalised".)

Similarly
  withFPtr :: FPtr a -> (Ptr a -> IO b) -> IO b

It's bizarre to have
   withForeignObj :: ForeignObj -> (Ptr a -> IO b) -> IO b


What think you?

Simon

_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi

Reply via email to