diff src/core_util.sml @ 179:3bbed533fbd2

Cases through monoize
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 10:48:36 -0400
parents 5d030ee143e2
children d11754ffe252
line wrap: on
line diff
--- a/src/core_util.sml	Sun Aug 03 09:26:49 2008 -0400
+++ b/src/core_util.sml	Sun Aug 03 10:48:36 2008 -0400
@@ -544,6 +544,14 @@
         S.Continue v => v
       | S.Return _ => raise Fail "CoreUtil.File.foldMap: Impossible"
 
+val maxName = foldl (fn ((d, _) : decl, count) =>
+                        case d of
+                            DCon (_, n, _, _) => Int.max (n, count)
+                          | DDatatype (_, n, _) => Int.max (n, count)
+                          | DVal (_, n, _, _, _) => Int.max (n, count)
+                          | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
+                          | DExport _ => count) 0
+              
 end
 
 end