query
On this page

traceFnSeqN

lib.debug.traceFnSeqN

Docs pulled from | This Revision | 10 minutes ago


Trace the input and output of a function f named name, both down to depth.

This is useful for adding around a function call, to see the before/after of values as they are transformed.

Inputs

depth

1. Function argument

name

2. Function argument

f

3. Function argument

v

4. Function argument

Examples

lib.debug.traceFnSeqN usage example

traceFnSeqN 2 "id" (x: x) { a.b.c = 3; }
trace: { fn = "id"; from = { a.b = {…}; }; to = { a.b = {…}; }; }
=> { a.b.c = 3; }

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

traceFnSeqN = depth: name: f: v:
    let res = f v;
    in lib.traceSeqN
        (depth + 1)
        {
          fn = name;
          from = v;
          to = res;
        }
        res;