Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type HasCallStack = ?callStack :: CallStack
- data CallStack
- withCallerCallStack :: HasCallStack => (CallStack -> b) -> b
- prettyCallSite :: CallSite -> String
- headCallSite :: CallStack -> Maybe CallSite
- withCurrentCallStack :: HasCallStack => (CallStack -> b) -> b
- prettyCallStack :: CallStack -> String
- type SrcLocPackage = String
- type SrcLocModule = String
- type SrcFun = String
- type SrcLocFile = String
- type SrcLocLine = Int
- type SrcLocCol = Int
- type CallSite = (SrcFun, SrcLoc)
- type CallSiteFilter = CallSite -> Bool
- prettySrcLoc :: SrcLoc -> String
- filterCallStack :: CallSiteFilter -> CallStack -> CallStack
- overCallSites :: ([CallSite] -> [CallSite]) -> CallStack -> CallStack
- popnCallStack :: Word -> CallStack -> CallStack
- truncatedCallStack :: CallStack -> CallStack
- withNBackCallStack :: HasCallStack => Word -> (CallStack -> b) -> b
- callStack :: HasCallStack => CallStack
- fromCallSiteList :: [([Char], SrcLoc)] -> CallStack
- getCallStack :: CallStack -> [([Char], SrcLoc)]
- data SrcLoc = SrcLoc {
- srcLocPackage :: [Char]
- srcLocModule :: [Char]
- srcLocFile :: [Char]
- srcLocStartLine :: Int
- srcLocStartCol :: Int
- srcLocEndLine :: Int
- srcLocEndCol :: Int
Documentation
type HasCallStack = ?callStack :: CallStack #
withCallerCallStack :: HasCallStack => (CallStack -> b) -> b Source #
prettyCallSite :: CallSite -> String Source #
The same as the un-exported internal function in GHC.Exceptions (prettyCallStackLines)
Prints like: doFoo, called at foo.hs:190:24 in main:Main
headCallSite :: CallStack -> Maybe CallSite Source #
Get the most recent CallSite
in a CallStack
, if there is one.
withCurrentCallStack :: HasCallStack => (CallStack -> b) -> b Source #
prettyCallStack :: CallStack -> String Source #
Pretty-print a CallStack
. This has a few differences from GHC.Stack.prettyCallStackLines
.
We omit the "CallStack (from GetCallStack)" header line for brevity.
If there is only one entry (which is common, due to the manual nature of the HasCallStack
constraint),
shows the entry on one line. If there are multiple, then the following lines are indented.
type SrcLocPackage = String Source #
Type of the package name of a SrcLoc
| e.g. `Agda-2.…`
type SrcLocModule = String Source #
Type of the module name of a SrcLoc
| e.g. Foo
type SrcLocFile = String Source #
Type of a filename of a SrcLoc
| e.g. `srcfullAgdaUtilsFoo.hs`
type SrcLocLine = Int Source #
Type of a line number of a SrcLoc
type CallSiteFilter = CallSite -> Bool Source #
Type of a filter for CallSite
prettySrcLoc :: SrcLoc -> String #
filterCallStack :: CallSiteFilter -> CallStack -> CallStack Source #
Transform a CallStack
by filtering each CallSite
overCallSites :: ([CallSite] -> [CallSite]) -> CallStack -> CallStack Source #
Transform a CallStack
by transforming its list of CallSite
popnCallStack :: Word -> CallStack -> CallStack Source #
Pops n entries off a CallStack
using popCallStack
.
Note that frozen callstacks are unaffected.
truncatedCallStack :: CallStack -> CallStack Source #
CallStack
comprising only the most recent CallSite
withNBackCallStack :: HasCallStack => Word -> (CallStack -> b) -> b Source #
callStack :: HasCallStack => CallStack #
fromCallSiteList :: [([Char], SrcLoc)] -> CallStack #
getCallStack :: CallStack -> [([Char], SrcLoc)] #
SrcLoc | |
|
Instances
Pretty CallSite Source # | |||||
Pretty SrcLoc Source # | |||||
EmbPrj SrcLoc Source # | |||||
NFData SrcLoc | |||||
Defined in Control.DeepSeq | |||||
Generic SrcLoc | |||||
Defined in GHC.Internal.Generics
| |||||
Show SrcLoc | |||||
Eq SrcLoc | |||||
type Rep SrcLoc | |||||
Defined in GHC.Internal.Generics type Rep SrcLoc = D1 ('MetaData "SrcLoc" "GHC.Internal.Stack.Types" "ghc-internal" 'False) (C1 ('MetaCons "SrcLoc" 'PrefixI 'True) ((S1 ('MetaSel ('Just "srcLocPackage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char]) :*: (S1 ('MetaSel ('Just "srcLocModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char]) :*: S1 ('MetaSel ('Just "srcLocFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Char]))) :*: ((S1 ('MetaSel ('Just "srcLocStartLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "srcLocStartCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "srcLocEndLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "srcLocEndCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) |