The motivation for this design is to make it so that
let
f = \x . E
in
... f y ...
Gives the same call stack as
... (\x . E) y ...
That is, inlining a function does not change the call stack. GHC
assumes that this is valid, so the call stack semantics should reflect that.
Dear list,
I am reading up on cost centre stacks. Simon Marlow's solving an old
problem-slides is the more recent resource I could find. On slide 43 he
describes a call function implemented as:
call Sapp Slam = foldr push Spre Slam’
where (Spre, Sapp’, Slam’) = commonPrefix Sapp