[m-rev.] diff: add some insts for use with assoc_lists.

Julien Fischer jfischer at opturion.com
Wed Jan 19 21:26:42 AEDT 2022


Add some insts for use with assoc_lists.

library/assoc_list.m:
     Add some convenience insts for use with assoc_lists.

Julien.

diff --git a/library/assoc_list.m b/library/assoc_list.m
index 8f01510..5e34bea 100644
--- a/library/assoc_list.m
+++ b/library/assoc_list.m
@@ -2,7 +2,7 @@
  % vim: ft=mercury ts=4 sw=4 et
  %---------------------------------------------------------------------------%
  % Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2010-2011 The University of Melbourne.
-% Copyright (C) 2013-2020 The Mercury team.
+% Copyright (C) 2013-2022 The Mercury team.
  % This file is distributed under the terms specified in COPYING.LIB.
  %---------------------------------------------------------------------------%
  %
@@ -29,6 +29,15 @@
  :- type assoc_list(T) == list(pair(T, T)).

  %---------------------------------------------------------------------------%
+
+    % These instantiation states can be used for instantiation
+    % state subtyping.
+    %
+:- inst assoc_list(I1, I2) == list(pair(I1, I2)).
+
+:- inst assoc_list(I) == list(pair(I, I)).
+
+%---------------------------------------------------------------------------%
  %
  % Creating assoc_lists from lists of keys and values.
  %


More information about the reviews mailing list