aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cjrize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-29 15:43:17 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-29 15:43:17 -0400
commit846cf3f1661a8c91e40d80382db28c76dceaf1f0 (patch)
treefe42c0c78660d50832719e1ae9fd9cda2d7e603f /src/cjrize.sml
parentcb3b3831a07d6674a5fa02e3e8a1e4329b58cb34 (diff)
Storing datatype constructors in type references past monoize
Diffstat (limited to 'src/cjrize.sml')
-rw-r--r--src/cjrize.sml16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cjrize.sml b/src/cjrize.sml
index cf32e414..a4f35723 100644
--- a/src/cjrize.sml
+++ b/src/cjrize.sml
@@ -84,7 +84,21 @@ fun cifyTyp ((t, loc), sm) =
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)