Skip to content

Allow CallStacks to be hidden or cut

This is a spin off of #11035. I’d like to see a way for a function foo

  • use another function bar with a (?_::CallStack) constraint so that bar will not print a call stack, and
  • use another function bar with a (?_::CallStack) constraint so that if bar prints a call stack, it will stop at the call to foo.

This might be possible to implement with a special rootCallStack :: CallStack which is a value such that

x `pushCallStack` rootCallStack = rootCallStack

but

rootCallStack `pushCallStack` x = rootCallStack “:” x

as before and a call stack that consists of only a rootCallStack causes no stack trace to be printed.

The use case is to provide the user of a library less cluttered call stacks that do not expose unhelpful details and allow her to quickly spot the relevant information.

Trac metadata
Trac field Value
Version 7.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information