comparison src/core_util.sml @ 398:ab3177746c78

Simple listShop working
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 13:24:54 -0400
parents 075b36dbb1a4
children bd9ee9aeca2f
comparison
equal deleted inserted replaced
397:4d519baf357c 398:ab3177746c78
783 | S.Return _ => raise Fail "CoreUtil.File.foldMap: Impossible" 783 | S.Return _ => raise Fail "CoreUtil.File.foldMap: Impossible"
784 784
785 val maxName = foldl (fn ((d, _) : decl, count) => 785 val maxName = foldl (fn ((d, _) : decl, count) =>
786 case d of 786 case d of
787 DCon (_, n, _, _) => Int.max (n, count) 787 DCon (_, n, _, _) => Int.max (n, count)
788 | DDatatype (_, n, _, _) => Int.max (n, count) 788 | DDatatype (_, n, _, ns) =>
789 foldl (fn ((_, n', _), m) => Int.max (n', m))
790 (Int.max (n, count)) ns
789 | DVal (_, n, _, _, _) => Int.max (n, count) 791 | DVal (_, n, _, _, _) => Int.max (n, count)
790 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis 792 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
791 | DExport _ => count 793 | DExport _ => count
792 | DTable (_, n, _, _) => Int.max (n, count) 794 | DTable (_, n, _, _) => Int.max (n, count)
793 | DSequence (_, n, _) => Int.max (n, count) 795 | DSequence (_, n, _) => Int.max (n, count)