Legend:

* [[GhcFile(compiler/prelude/PrelNames.lhs)]] -- add a new unique id using mkPreludeTyConUnique

109

109

110

* [[GhcFile(compiler/prelude/TysPrim.lhs)]] -- there are a raft of changes here; you need to create {{{*PrimTy}}}, {{{*PrimTyCon}}} and {{{*PrimTyConName}}} variables. The most important thing to make sure you get right is when you make a PrimTyCon, you pick the correct {{{PrimRep}} for your type. For example, if you’ve introduced a new GC'able object, you should use {{{PtrRep}}}; however, if it's a pointer that shouldn't be GC'd, you should use {{{AddrRep}}} instead. The full list is in [[GhcFile(compiler/types/TyCon.lhs)]]

110

* [[GhcFile(compiler/prelude/TysPrim.lhs)]] -- there are a raft of changes here; you need to create {{{*PrimTy}}}, {{{*PrimTyCon}}} and {{{*PrimTyConName}}} variables. The most important thing to make sure you get right is when you make a PrimTyCon, you pick the correct {{{PrimRep}}} for your type. For example, if you’ve introduced a new GC'able object, you should use {{{PtrRep}}}; however, if it's a pointer that shouldn't be GC'd, you should use {{{AddrRep}}} instead. The full list is in [[GhcFile(compiler/types/TyCon.lhs)]]

111

111

112

112

See also AddingNewPrimitiveOperations, a blow-by-blow description of the process for adding a new out-of-line primop from someone who went through the process.