Save the type of breakpoints in the Breakpoint tick in STG
We need to preserve the type of breakpoints to be able to generate GHCi bytecode from STG instead of core (see !4412 (closed), which adds unboxed sums and tuples support to GHCi).
In !4412 (closed) I first added a Type
/Maybe Type
field to the StgTick
constructor, which has the downside of being imprecise. We really only need to preserve the type for breakpoints, not for other ticks, for the time being.
This is an attempt to make it precise using a ttg scheme:
- Generalise
Tickish
toGenTickish pass
with anXBreakpoint
extension field inBreakpoint
-
type Tickish = GenTickish 'TickishCore
for the core phase.XBreakpoint
is empty, so we can retain theOrd
andEq
instances as before -
type StgTickish = GenTickish 'TickishStg
,XBreakpoint
isType
. -
CoreToStg
now also converts theTickish
values.
I think the id
type argument of Tickish
(and now GenTickish
) can now actually be dropped, and replaced by type functions of TickishPass
. I haven't had time to implement this yet.
If this gets accepted, I'll rebase !4412 (closed) on top of this.