# HG changeset patch # User Adam Chlipala # Date 1406659130 14400 # Node ID e762c96fffb7d50a22f78795069015382b1f6660 # Parent 336070df8aec2caf8690fbbac6ae0d1e5fa09a79 Small tweak to ordering of unification rules, to support better record matching diff -r 336070df8aec -r e762c96fffb7 src/elaborate.sml --- 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) => () diff -r 336070df8aec -r e762c96fffb7 tests/empty_record.ur --- /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 diff -r 336070df8aec -r e762c96fffb7 tests/empty_record.urp --- /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