Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.CallStack

Description

Utilities for GHC's implicit call stacks feature.

Synopsis

Documentation

type Stack = Stack.HasCallStack Source #

Add this to the context of a function to give stack-aware functions access to its caller.

TODO use Stack.HasCallStack instead? Or not, I already have Derive.Stack and GHC.Stack.HasCallStack is pretty verbose.

data Caller Source #

Simplified stack with just the immediate caller.

Constructors

Caller !FilePath !Int 
NoCaller 

Instances

Instances details
Read Caller Source # 
Instance details

Defined in Util.CallStack

Show Caller Source # 
Instance details

Defined in Util.CallStack

Eq Caller Source # 
Instance details

Defined in Util.CallStack

Methods

(==) :: Caller -> Caller -> Bool #

(/=) :: Caller -> Caller -> Bool #

Serialize Caller Source # 
Instance details

Defined in Util.Serialize

FromJSON Caller Source # 
Instance details

Defined in Util.CallStack

ToJSON Caller Source # 
Instance details

Defined in Util.CallStack

errorStack :: Stack => Text -> a Source #

Like error, use when forced.

errorIO :: Stack => MonadIO m => Text -> m a Source #

Throw an error in IO, with a stack.

getStack :: Stack => Text Source #

This is like Stack.prettyCallStack, except more compact.

getStack1 :: Stack => Text Source #

Get only the top of the stack. More compact than getStack.

throw :: (Stack, Exception.Exception e) => (Text -> e) -> Text -> a Source #