diff src/cjrize.sml @ 168:25b169416ea8

Storing datatype constructors in type references past monoize
author Adam Chlipala <adamc@hcoop.net>
date Tue, 29 Jul 2008 15:43:17 -0400
parents a991431b77eb
children eb3f9913bf31
line wrap: on
line diff
--- a/src/cjrize.sml	Tue Jul 29 15:25:42 2008 -0400
+++ b/src/cjrize.sml	Tue Jul 29 15:43:17 2008 -0400
@@ -84,7 +84,21 @@
         in
             ((L'.TRecord si, loc), sm)
         end
-      | L.TNamed n => ((L'.TDatatype n, loc), sm)
+      | L.TDatatype (n, xncs) =>
+        let
+            val (xncs, sm) = ListUtil.foldlMap (fn ((x, n, to), sm) =>
+                                                   case to of
+                                                       NONE => ((x, n, NONE), sm)
+                                                     | SOME t =>
+                                                       let
+                                                           val (t, sm) = cifyTyp (t, sm)
+                                                       in
+                                                           ((x, n, SOME t), sm)
+                                                       end)
+                             sm xncs
+        in
+            ((L'.TDatatype (n, xncs), loc), sm)
+        end
       | L.TFfi mx => ((L'.TFfi mx, loc), sm)
 
 val dummye = (L'.EPrim (Prim.Int 0), ErrorMsg.dummySpan)