changeset 250:98f551ddd54b

Fix Core con comparison
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 09:52:52 -0400
parents b6b75e6e0898
children 326fb4686f60
files src/core_util.sml
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/core_util.sml	Sun Aug 31 09:45:23 2008 -0400
+++ b/src/core_util.sml	Sun Aug 31 09:52:52 2008 -0400
@@ -160,9 +160,15 @@
 
       | (CRecord (k1, xvs1), CRecord (k2, xvs2)) =>
         join (Kind.compare (k1, k2),
-              fn () => joinL (fn ((x1, v1), (x2, v2)) =>
-                                 join (compare (x1, x2),
-                                       fn () => compare (v1, v2))) (xvs1, xvs2))
+              fn () =>
+                 let
+                     val sort = ListMergeSort.sort (fn ((x1, _), (x2, _)) =>
+                                                       compare (x1, x2) = GREATER)
+                 in
+                     joinL (fn ((x1, v1), (x2, v2)) =>
+                               join (compare (x1, x2),
+                                  fn () => compare (v1, v2))) (sort xvs1, sort xvs2)
+                 end)
       | (CRecord _, _) => LESS
       | (_, CRecord _) => GREATER