
Gah. We have no way to be polymorphic over all pointers (both lifted and unlifted) but not over Int# etc.
As you say, this is too much of a special case to make an invasive change.
I’m quite dubious about making weak poitners to unlifted heap-allocated objects. I can’t say it’s wrong but it feels dodgy to me.
Simon
From: David Feuer
| Huh! It looks like what we currently do for some primops is just use a | totally bogus kind. For example, mkWeak# will happily accept an Int# as | its first argument.
Well, I see primop MkWeakOp "mkWeak#" GenPrimOp o -> b -> (State# RealWorld -> (# State# RealWorld, c #))
and I believe (from Ben's message) that the "o" means "open type variable", which is the old terminology for what we now call levity-polymorphic.
Right; currently (largely for historical reasons) we use `o` to accommodate cases that accept both lifted and unlifted pointers. Cheers, - Ben