summaryrefslogtreecommitdiff
path: root/src/core_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 10:48:36 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 10:48:36 -0400
commitc0b7963e91681045bb4c82a2356776fae54f54c5 (patch)
tree5f098f60e48ade5cd1bfcb3a69e9b4ef9cb605ff /src/core_util.sml
parent5e0563d3b00303d5053827e46811c93077455208 (diff)
Cases through monoize
Diffstat (limited to 'src/core_util.sml')
-rw-r--r--src/core_util.sml8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core_util.sml b/src/core_util.sml
index 85cf24ac..7ec4fa6c 100644
--- a/src/core_util.sml
+++ b/src/core_util.sml
@@ -544,6 +544,14 @@ fun foldMap {kind, con, exp, decl} s d =
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