Implement Pointer Rep Proposal
Implement GHC Proposal 203, the Pointer Rep proposal.
I'm going to start on this, but I'd like to solicit some input on one design decision. Internally, GHC uses both a PrimRep
type and a RuntimeRep
type. The relationship between the two is well documented in Note [RuntimeRep and PrimRep]
and Note [Getting from RuntimeRep to PrimRep]
. The change that should be made to RuntimeRep
is obvious. It is specified in the proposal. The change to PrimRep
is (to me) less obvious. Currently, PrimRep
is:
data PrimRep = LiftedRep | UnliftedRep | IntRep ...
I suspect that it would be a mistake to change PrimRep
to:
data Levity = Lifted | Unlifted
data PrimRep = BoxedRep Levity | IntRep ...
I think it should be left alone. Does anyone more familiar with the runtime representation code have some intuition for the right change here?