Skip to content

Make `GHC.Stack.SrcLoc` more strict?

While inspecting the core of a library I wrote, I noticed that there are a lot of SrcLocs being generated. SrcLoc has four Int fields (without strictness annotations), so there are a lot of (boxed) Ints floating around for the line/column numbers.

Is there any reason those aren't strict? As far as I can tell, the line/column numbers are all known at compile time anyway. Adding strictness annotations would allow them to be unboxed, resulting in less allocations (and make the generated core smaller).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information