diff src/reduce.sml @ 807:61a1f5c5ae2c

Mutual datatypes through Effectize
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 May 2009 15:45:12 -0400
parents 8688e01ae469
children 669ac5e9a69e
line wrap: on
line diff
--- a/src/reduce.sml	Sat May 16 15:22:05 2009 -0400
+++ b/src/reduce.sml	Sat May 16 15:45:12 2009 -0400
@@ -442,13 +442,14 @@
                     ((DCon (x, n, k, c), loc),
                      (IM.insert (namedC, n, c), namedE))
                 end
-              | DDatatype (x, n, ps, cs) =>
-                let
-                    val env = map (fn _ => UnknownC) ps
-                in
-                    ((DDatatype (x, n, ps, map (fn (x, n, co) => (x, n, Option.map (con namedC env) co)) cs), loc),
-                     st)
-                end
+              | DDatatype dts =>
+                ((DDatatype (map (fn (x, n, ps, cs) =>
+                                     let
+                                         val env = map (fn _ => UnknownC) ps
+                                     in
+                                         (x, n, ps, map (fn (x, n, co) => (x, n, Option.map (con namedC env) co)) cs)
+                                     end) dts), loc),
+                 st)
               | DVal (x, n, t, e, s) =>
                 let
                     val t = con namedC [] t