changeset 2043:e762c96fffb7

Small tweak to ordering of unification rules, to support better record matching
author Adam Chlipala <adam@chlipala.net>
date Tue, 29 Jul 2014 14:38:50 -0400
parents 336070df8aec
children 42ae25a354f8
files src/elaborate.sml tests/empty_record.ur tests/empty_record.urp
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Sat Jul 26 09:39:45 2014 -0400
+++ b/src/elaborate.sml	Tue Jul 29 14:38:50 2014 -0400
@@ -1220,6 +1220,11 @@
              else
                  err (fn _ => TooLifty (loc1, loc2))
 
+           | (L'.CRecord _, _) => isRecord ()
+           | (_, L'.CRecord _) => isRecord ()
+           | (L'.CConcat _, _) => isRecord ()
+           | (_, L'.CConcat _) => isRecord ()
+
            | (L'.CUnif (0, _, _, _, r as ref (L'.Unknown f)), _) =>
              if occursCon r c2All then
                  err COccursCheckFailed
@@ -1262,11 +1267,6 @@
                   end
                   handle CantSquish => err (fn _ => TooDeep))
 
-           | (L'.CRecord _, _) => isRecord ()
-           | (_, L'.CRecord _) => isRecord ()
-           | (L'.CConcat _, _) => isRecord ()
-           | (_, L'.CConcat _) => isRecord ()
-
 
            | (L'.CUnit, L'.CUnit) => ()
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/empty_record.ur	Tue Jul 29 14:38:50 2014 -0400
@@ -0,0 +1,3 @@
+val concatX [ctx ::: {Unit}] [use ::: {Type}]
+    : list (xml ctx use []) -> xml ctx use []
+  = List.foldl join <xml/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/empty_record.urp	Tue Jul 29 14:38:50 2014 -0400
@@ -0,0 +1,2 @@
+$/list
+empty_record