Eliminate excessive RuntimeRep polymorphism in primops
Currently there are numerous primops whose types are parametrically polymorphic in RuntimeRep
yet only work with pointers (namely LiftedPtrRep
and UnliftedPtrRep
). This uneasy situation is forced by the fact that we currently don't have a convenient way to distinguish pointers from non-pointers. #17526 (closed) (GHC proposal 203) replaces the LiftedPtrRep
and UnliftedPtrRep
constructors of RuntimeRep
with a BoxedRep :: Levity -> RuntimeRep
constructor. This will allow us to give the correct types to the following primops:
-
mkWeak#
andmkWeakNoFinalizer#
-
touch#
-
keepAlive#
(once it's merged; see #17760 (closed))
Implementing this idea depends on completing !2249 (closed) (BoxedRep)