On Tue, 28 Mar 2000, Fergus Henderson wrote:

>       `struct HsStablePtrSomeUserDefinedTypeConstructor *'.
> 
> Actually on second thoughts I think that should perhaps be just
> 
>       `struct HsSomeUserDefinedTypeConstructor *'
> 
> and likewise for all the other mappings from `StablePtr' types;

"HsInt *"? Certainly no, because it is not a pointer to HsInt. You can't
dereference it and get HsInt, it's an abstract type - it would be
misleading. Do you want to mirror every type constructor and provide a C
type for each to use as a tag of StablePtr only?

StablePtrs are most often used either polymorphically or with complex
types (because simple monomorphic types like Int will be usually passed
unboxed). Exactly the cases where your C pointer trick is hard! And
generally StablePtrs should not be used very frequently.

IMHO it's much more complications than advantages.

-- 
Marcin 'Qrczak' Kowalczyk


Reply via email to