[m-rev.] for review: fix a reference manual error

Julien Fischer jfischer at opturion.com
Sat Apr 17 13:52:32 AEST 2021


For review by anyone.

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

Fix a reference manual error.

doc/reference_manual.texi:
     Fix an error in the higher-order inst example reported on m-users:
     the higher-order inst in a mode definition was lacking parentheses.
     Fix this and add an explanation of why the parentheses are necessary.

     Delete a doubled-up word.

Julien.

diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
index 41b0e10..d97077f 100644
--- a/doc/reference_manual.texi
+++ b/doc/reference_manual.texi
@@ -2652,7 +2652,7 @@ Example:
  Subtypes must not have user-defined equality or comparison predicates.
  The base type of a subtype may have user-defined equality or comparison.
  In that case, values of the subtype will be tested for equality or
-or compared using those predicates.
+compared using those predicates.

  There is no special interaction between subtypes and the type class system.

@@ -5145,11 +5145,16 @@ For example:

  @example
  :- pred foo(pred(int)).
-:- mode foo(free >> pred(out) is det) is det.
+:- mode foo(free >> (pred(out) is det)) is det.

  foo(sum([1,2,3])).
  @end example

+In the above mode declaration, the current Mercury implementation
+requires parentheses around the higher-order inst.
+(This is because the operator @samp{>>} binds more tightly then the operator
+ at samp{is}.)
+
  Note that in Mercury it is an error to attempt to unify two higher-order terms.
  This is because equivalence of higher-order terms
  is undecidable in the general case.


More information about the reviews mailing list