[m-rev.] for review: clarify behaviour of multi_maps with duplicate values

Julien Fischer jfischer at opturion.com
Fri Apr 5 17:17:01 AEDT 2024


For review by anyone.
---------------------

Clarify behaviour of multi_maps with duplicate values.

library/multi_map.m:
library/one_or_more_map.m:
      Mention that multiple occurrence of the same value can be
      associated with a key.

Julien.

diff --git a/library/multi_map.m b/library/multi_map.m
index d53ec46..365b5ec 100644
--- a/library/multi_map.m
+++ b/library/multi_map.m
@@ -2,7 +2,7 @@
  % vim: ts=4 sw=4 et ft=mercury
  %---------------------------------------------------------------------------%
  % Copyright (C) 1995, 1997, 2000, 2002-2006, 2011 The University of Melbourne.
-% Copyright (C) 2014-2022 The Mercury team.
+% Copyright (C) 2014-2024 The Mercury team.
  % This file is distributed under the terms specified in COPYING.LIB.
  %---------------------------------------------------------------------------%
  %
@@ -14,6 +14,7 @@
  % A map (also known as a dictionary or an associative array) is a collection
  % of (Key, Value) pairs which allows you to look up any Value given the Key.
  % A multi_map is similar, but it allows more than one Value for each Key.
+% Multiple occurrences of the same Value can be associated with a given Key.
  %
  % This is implemented almost as a special case of map.m.
  %
diff --git a/library/one_or_more_map.m b/library/one_or_more_map.m
index 2604253..dcaefdd 100644
--- a/library/one_or_more_map.m
+++ b/library/one_or_more_map.m
@@ -15,7 +15,8 @@
  % but does not express the invariant maintained by the relevant operations,
  % which is that these lists are never empty. A one_or_more_map is a multi_map
  % in which the range type is not list(V) but one_or_more(V), which *does*
-% express this invariant.
+% express this invariant. Multiple occurrences of the same Value can be
+% associated with a given Key.
  %
  %---------------------------------------------------------------------------%



More information about the reviews mailing list