Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
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
FromJSON Caller Source # 
Instance details

Defined in Util.CallStack

ToJSON Caller Source # 
Instance details

Defined in Util.CallStack

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

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 #