More explict comments for the 'trace' and 'traceVal' Prelude operations.

This commit is contained in:
Robert Dockins 2016-07-13 14:16:33 -07:00
parent 222c6edd82
commit e0611c250d

View File

@ -330,10 +330,28 @@ groupBy = split`{parts=parts}
type lg2 n = width (max n 1 - 1)
/**
* Debugging function for tracing values. The value of the
* first argument is printed before returning the second value.
* Debugging function for tracing. The first argument is a string,
* which is prepended to the printed value of the second argument.
* This combined string is then printed when the trace function is
* evaluated. The return value is equal to the third argument.
*
* The exact timing and number of times the trace message is printed
* depend on the internal details of the Cryptol evaluation order,
* which are unspecified. Thus, the output produced by this
* operation may be difficult to predict.
*/
primitive trace : {n, a, b} [n][8] -> a -> b -> b
/**
* Debugging function for tracing values. The first argument is a string,
* which is prepended to the printed value of the second argument.
* This combined string is then printed when the trace function is
* evaluated. The return value is equal to the second argument.
*
* The exact timing and number of times the trace message is printed
* depend on the internal details of the Cryptol evaluation order,
* which are unspecified. Thus, the output produced by this
* operation may be difficult to predict.
*/
traceVal : {n, a} [n][8] -> a -> a
traceVal msg x = trace msg x x