summaryrefslogtreecommitdiff
path: root/src/specialize.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/specialize.sml')
-rw-r--r--src/specialize.sml14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/specialize.sml b/src/specialize.sml
index b740ec8c..43c634c7 100644
--- a/src/specialize.sml
+++ b/src/specialize.sml
@@ -246,15 +246,12 @@ fun specialize file =
let
(*val () = Print.preface ("decl:", CorePrint.p_decl CoreEnv.empty all)*)
val (d, st) = specDecl st d
-
- val ds =
- case #decls st of
- [] => []
- | dts => [(DDatatype dts, #2 d)]
in
case #1 d of
DDatatype dts =>
- (rev (d :: ds),
+ ((case #decls st of
+ [] => [d]
+ | dts' => [(DDatatype (dts' @ dts), #2 d)]),
{count = #count st,
datatypes = foldl (fn ((x, n, xs, xnts), dts) =>
IM.insert (dts, n,
@@ -270,7 +267,9 @@ fun specialize file =
(#constructors st) dts,
decls = []})
| _ =>
- (rev (d :: ds),
+ (case #decls st of
+ [] => [d]
+ | dts => [(DDatatype dts, #2 d), d],
{count = #count st,
datatypes = #datatypes st,
constructors = #constructors st,
@@ -286,5 +285,4 @@ fun specialize file =
ds
end
-
end