[m-rev.] for review: add documentation for benchmkar_det_io/7

Julien Fischer jfischer at opturion.com
Sun Oct 17 20:14:44 AEDT 2021


For review by anyone.

-------------------

Add documentation for benchmark_det_io/7.

library/benchmarking.m:
    As above.

    Position the description of benchmark_func/5 directly above
    its declaration.

Julien.

diff --git a/library/benchmarking.m b/library/benchmarking.m
index dba6404..19b5e56 100644
--- a/library/benchmarking.m
+++ b/library/benchmarking.m
@@ -71,16 +71,23 @@
      % interval. The number of milliseconds required to execute Pred with input
      % In this many times is returned as Time.
      %
-    % benchmark_func(Func, In, Out, Repeats, Time) does for functions
-    % exactly what benchmark_det does for predicates.
-    %
  :- pred benchmark_det(pred(T1, T2), T1, T2, int, int).
  :- mode benchmark_det(pred(in, out) is det, in, out, in, out) is cc_multi.
  :- mode benchmark_det(pred(in, out) is cc_multi, in, out, in, out) is cc_multi.

+    % benchmark_func(Func, In, Out, Repeats, Time) does for functions exactly
+    % what benchmark_det does for predicates.
+    %
  :- pred benchmark_func(func(T1) = T2, T1, T2, int, int).
  :- mode benchmark_func(func(in) = out is det, in, out, in, out) is cc_multi.

+    % benchmark_det_io(Pred, In, Out, !State, Repeats, Time) is similar to
+    % benchmark_det, except that it used for benchmarking a det predicate Pred
+    % which destructively updates some unique state State, in addition to
+    % taking the input In and producing the output Out.
+    % State will usually be the I/O state, but it may be some other unique
+    % data structure.
+    %
  :- pred benchmark_det_io(pred(T1, T2, T3, T3), T1, T2, T3, T3, int, int).
  :- mode benchmark_det_io(pred(in, out, di, uo) is det, in, out, di, uo,
      in, out) is cc_multi.



More information about the reviews mailing list