ghc-internal-9.1500.0: Basic libraries
Safe HaskellNone
LanguageHaskell2010

GHC.Internal.Stack.Annotation

Synopsis

Documentation

class StackAnnotation a where Source #

StackAnnotations are types which can be pushed onto the call stack as the payload of AnnFrame stack frames.

Methods

displayStackAnnotation :: a -> String Source #

Display a human readable string for the StackAnnotation.

This is supposed to be the long version of displayStackAnnotationShort and may contain a source location.

If not provided, displayStackAnnotation is derived from stackAnnotationSourceLocation and displayStackAnnotationShort.

stackAnnotationSourceLocation :: a -> Maybe SrcLoc Source #

Get the SrcLoc of the given StackAnnotation.

This is optional, SrcLoc are not strictly required for StackAnnotation, but it is still heavily encouarged to provide a SrcLoc for better IPE backtraces.

displayStackAnnotationShort :: a -> String Source #

The description of the StackAnnotation without any metadata such as source locations.

Pefer implementing displayStackAnnotationShort over displayStackAnnotation.

data SomeStackAnnotation where Source #

The SomeStackAnnotation type is the root of the stack annotation type hierarchy. When the call stack is annotated with a value of type a, behind the scenes it is encapsulated in a SomeStackAnnotation.

Constructors

SomeStackAnnotation :: forall a. (Typeable a, StackAnnotation a) => a -> SomeStackAnnotation