# HG changeset patch # User Adam Chlipala # Date 1335746265 14400 # Node ID d2b3fada532e5b410cd99e6800f341b7955fad93 # Parent ab24a7cb2a640177cf3cc0c198b56dd4e4a6b840 Fix generation of normal datatypes from polymorphic variants diff -r ab24a7cb2a64 -r d2b3fada532e src/mono_print.sml --- a/src/mono_print.sml Sun Apr 29 16:23:03 2012 -0400 +++ b/src/mono_print.sml Sun Apr 29 20:37:45 2012 -0400 @@ -400,7 +400,8 @@ let val env = E.pushDatatype env x n cons in - box [string x, + box [if !debug then (string (x ^ "__" ^ Int.toString n)) + else string x, space, string "=", space, diff -r ab24a7cb2a64 -r d2b3fada532e src/monoize.sml --- 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)