Skip to content
CCPEDIAby Unity Nodes
Documentation/Canton Network Docs/Daml Standard LibraryModulesView on Canton Network Docs

DA.Stack

Daml module

DA.Stack

-

Data Types

data SrcLoc

Location in the source code. Line and column are 0-based. Constructors:
  • SrcLoc
srcLocPackage
Text
srcLocModule
Text
srcLocFile
Text
srcLocStartLine
Int
srcLocStartCol
Int
srcLocEndLine
Int
srcLocEndCol
Int
Instances:

data CallStack

Type of callstacks constructed automatically from HasCallStack constraints. Use callStack to get the current callstack, and use getCallStack to deconstruct the CallStack.

type HasCallStack

= IP callStack CallStack Request a CallStack. Use this as a constraint in type signatures in order to get nicer callstacks for error and debug messages. For example, instead of declaring the following type signature:
myFunction : Int -> Update ()
You can declare a type signature with the HasCallStack constraint:
myFunction : HasCallStack => Int -> Update ()
The function myFunction will still be called the same way, but it will also show up as an entry in the current callstack, which you can obtain with callStack. Note that only functions with the HasCallStack constraint will be added to the current callstack, and if any function does not have the HasCallStack constraint, the callstack will be reset within that function.

Functions

prettyCallStack

prettyCallStack : CallStack -> Text Pretty-print a CallStack.

getCallStack

getCallStack : CallStack -> [(Text, SrcLoc)] Extract the list of call sites from the CallStack. The most recent call comes first.

callStack

callStack : HasCallStack => CallStack Access to the current CallStack.

History

Updated3.5.2

Module declarations or documentation updated.