call-stack-0.4.0: Use GHC call-stacks in a backward compatible way

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.CallStack

Synopsis

- type HasCallStack = ?callStack :: CallStack
- type CallStack = [(String, SrcLoc)]
- data SrcLoc = SrcLoc {
  - srcLocPackage :: [Char]
  - srcLocModule :: [Char]
  - srcLocFile :: [Char]
  - srcLocStartLine :: Int
  - srcLocStartCol :: Int
  - srcLocEndLine :: Int
  - srcLocEndCol :: Int
  }
- callStack :: HasCallStack => CallStack
- callSite :: HasCallStack => Maybe (String, SrcLoc)

# Documentation

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

type CallStack = [(String, SrcLoc)] Source #

data SrcLoc Source #

A single location in the source code.

Since: base-4.8.1.0

Constructors

SrcLoc |

Fields

- srcLocPackage :: [Char]
- srcLocModule :: [Char]
- srcLocFile :: [Char]
- srcLocStartLine :: Int
- srcLocStartCol :: Int
- srcLocEndLine :: Int
- srcLocEndCol :: Int

#### Instances

Instances details

Show SrcLoc | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Show Methods showsPrec :: Int -> SrcLoc -> ShowS Source # show :: SrcLoc -> String Source # showList :: [SrcLoc] -> ShowS Source #
Eq SrcLoc | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Stack.Types Methods (==) :: SrcLoc -> SrcLoc -> Bool Source # (/=) :: SrcLoc -> SrcLoc -> Bool Source #

callStack :: HasCallStack => CallStack Source #

callSite :: HasCallStack => Maybe (String, SrcLoc) Source #