cos package:ghc

Show a CostCentreStack as a [String]
A Cost Centre is a single {-# SCC #-} annotation.
A Cost Centre Stack is something that can be attached to a closure. This is either:
  • the current cost centre stack (CCCS)
  • a pre-defined cost centre stack (there are several pre-defined CCSs, see below).
An index into a given cost centre module,name,flavour set
Per-module state for tracking cost centre indices. See documentation of cc_flavour for more details.
Cost centre scoping: We don't want any costs to move to other cost-centre stacks. This means we not only want no code or cost to get moved out of their cost centres, but we also object to code getting associated with new cost-centre ticks - or changing the order in which they get applied. A rule of thumb is that we don't want any code to gain new annotations. However, there are notable exceptions, for example: let f = y -> foo in tick... ... (f x) ... ==> tick... ... foo[x/y] ... In-lining lambdas like this is always legal, because inlining a function does not change the cost-centre stack when the function is called.