panic-0.4.0.1: A convenient way to panic.

Safe Haskell | Trustworthy
Language | Haskell2010

Panic

Synopsis

- data Panic a = Panic {
  - panicComponent :: a
  - panicLoc :: String
  - panicMsg :: [String]
  - panicStack :: CallStack
  }
- class Typeable a => PanicComponent a where
  - panicComponentName :: a -> String
  - panicComponentIssues :: a -> String
  - panicComponentRevision :: a -> (String, String)
- useGitRevision :: Q Exp
- type HasCallStack = ?callStack :: CallStack
- panic :: (PanicComponent a, HasCallStack) => a -> String -> [String] -> b

# Documentation

data Panic a Source #

The exception thrown when panicing.

Constructors

Panic |

Fields

- panicComponent :: a
- panicLoc :: String
- panicMsg :: [String]
- panicStack :: CallStack

#### Instances

Instances details

PanicComponent a => Exception (Panic a) Source # |
Instance details Defined in Panic Methods toException :: Panic a -> SomeException Source # fromException :: SomeException -> Maybe (Panic a) Source # displayException :: Panic a -> String Source # backtraceDesired :: Panic a -> Bool Source #
PanicComponent a => Show (Panic a) Source # |
Instance details Defined in Panic Methods showsPrec :: Int -> Panic a -> ShowS Source # show :: Panic a -> String Source # showList :: [Panic a] -> ShowS Source #

class Typeable a => PanicComponent a where Source #

Description of a component.

Methods

panicComponentName :: a -> String Source #

Name of the panicing component.

panicComponentIssues :: a -> String Source #

Issue tracker for the panicking component.

panicComponentRevision :: a -> (String, String) Source #

Information about the component's revision. (commit hash, branch info)

useGitRevision :: Q Exp Source #

An expression of type `a -> (String,String)`. Uses template Haskell to query Git for the current state of the repo. Note that the state reported depends on when the module containing the splice was compiled.

type HasCallStack = ?callStack :: CallStack Source #

Request a CallStack.

NOTE: The implicit parameter `?callStack :: CallStack` is an implementation detail and should not be considered part of the `CallStack` API, we may decide to change the implementation in the future.

Since: base-4.9.0.0

panic Source #

Arguments

:: (PanicComponent a, HasCallStack) |
=> a | Component identification
-> String | Location of problem
-> [String] | Problem description (lines)
-> b |

Throw an exception for the given component.