debug.nix: add traceSeq & traceValSeq
Debugging functions that strictly deep-evaluate the argument that should
be traced.
commit6889f53397edf4c2e94df67d72ef0b1e7b18d35a
authorProfpatsch <mail@profpatsch.de>
dateSun 26 Jun 2016, 01:28 (10 years ago)
parent9ef6dce
lib/debug.nix+4
@@ -19,6 +19,10 @@ rec {
1919 traceXMLVal = x: trace (builtins.toXML x) x;
2020 traceXMLValMarked = str: x: trace (str + builtins.toXML x) x;
2121
22+ # strict trace functions (traced structure is fully evaluated and printed)
23+ traceSeq = x: y: trace (builtins.deepSeq x x) y;
24+ traceValSeq = v: traceVal (builtins.deepSeq v v);
25+
2226 # this can help debug your code as well - designed to not produce thousands of lines
2327 traceShowVal = x : trace (showVal x) x;
2428 traceShowValMarked = str: x: trace (str + showVal x) x;