ghc-internal-9.1201.0: Basic libraries
Copyright(c) The University of Glasgow 1998-2002
Licensesee libraries/base/LICENSE
Maintainercvs-ghc@haskell.org
Stabilityinternal
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

GHC.Internal.Exception.Context

Description

Exception context type.

Exception context

data ExceptionContext Source #

Exception context represents a list of ExceptionAnnotation s. These are attached to SomeExceptions via addExceptionContext and can be used to capture various ad-hoc metadata about the exception including backtraces and application-specific context.

ExceptionContext s can be merged via concatenation using the Semigroup instance or mergeExceptionContext .

Note that GHC will automatically solve implicit constraints of type ExceptionContext with emptyExceptionContext .

Constructors

Instances

Instances details

emptyExceptionContext :: ExceptionContext Source #

An ExceptionContext containing no annotations.

Since: base-4.20.0.0

addExceptionAnnotation :: ExceptionAnnotation a => a -> ExceptionContext -> ExceptionContext Source #

Construct a singleton ExceptionContext from an ExceptionAnnotation .

Since: base-4.20.0.0

getExceptionAnnotations :: ExceptionAnnotation a => ExceptionContext -> [a] Source #

Retrieve all ExceptionAnnotation s of the given type from an ExceptionContext .

Since: base-4.20.0.0

getAllExceptionAnnotations :: ExceptionContext -> [SomeExceptionAnnotation] Source #

mergeExceptionContext :: ExceptionContext -> ExceptionContext -> ExceptionContext Source #

Merge two ExceptionContext s via concatenation

Since: base-4.20.0.0

displayExceptionContext :: ExceptionContext -> String Source #

Render ExceptionContext to a human-readable String .

Since: base-4.20.0.0

Exception annotations

data SomeExceptionAnnotation Source #

Constructors

class Typeable a => ExceptionAnnotation a where Source #

ExceptionAnnotation s are types which can decorate exceptions as ExceptionContext .

Since: base-4.20.0.0

Minimal complete definition

Nothing

Methods

displayExceptionAnnotation :: a -> String Source #

Render the annotation for display to the user.

Instances

Instances details

AltStyle によって変換されたページ (->オリジナル) /