> OK, you are saying that the ForeignObj# is a representation 
> of a 'Ptr a', 
> but in a way such that the compiler can't optimise away the 
> box. Is that 
> correct?

Yes, that's right.

> Could ForeignPtr be generalised so that its ForeignObj# could 
> represent any type, rather than just a Ptr?

Unfortunately no.  The ForeignObj# type is unlifted, which means it
doesn't have _|_ as a possible value.  The same restrictions as for
unboxed types apply: you can't instantiate a polymorphic type variable
with ForeignObj#, or indeed any primitive type.

Cheers,
        Simon

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to