diff src/monoize.sml @ 1734:d2b3fada532e

Fix generation of normal datatypes from polymorphic variants
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 Apr 2012 20:37:45 -0400
parents 02533f681ad2
children f9e5a8e09cdf
line wrap: on
line diff
--- a/src/monoize.sml	Sun Apr 29 16:23:03 2012 -0400
+++ b/src/monoize.sml	Sun Apr 29 20:37:45 2012 -0400
@@ -69,6 +69,8 @@
         let
             val n = choosePvar ()
             val fs = map (fn (x, t) => (x, choosePvar (), t)) r'
+            val r = ListMergeSort.sort (fn (((L.CName x, _), _), ((L.CName y, _), _)) => String.compare (x, y) = GREATER
+                                         | _ => raise Fail "Monoize: pvar, not CName") r
             val (r, fs') = ListPair.foldr (fn ((_, t), (x, n, _), (r, fs')) =>
                                               ((x, n, SOME t) :: r,
                                                SM.insert (fs', x, n))) ([], SM.empty) (r, fs)