Closed
Description
There might well be one already, but I looked under the "Assertions and Debugging" section of the stdlib docs and only saw assertions.
Basically, I want a function that is equivalent to
local const(str, x) = x;
But that prints str
to stderr
as a side effect when forced. Very handy for debugging odd execution flow and the like.
Both Haskell and Nix call this function trace
, but I'm open to other ideas.