diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-29 15:43:17 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-29 15:43:17 -0400 |
commit | 846cf3f1661a8c91e40d80382db28c76dceaf1f0 (patch) | |
tree | fe42c0c78660d50832719e1ae9fd9cda2d7e603f /src/cjrize.sml | |
parent | cb3b3831a07d6674a5fa02e3e8a1e4329b58cb34 (diff) |
Storing datatype constructors in type references past monoize
Diffstat (limited to 'src/cjrize.sml')
-rw-r--r-- | src/cjrize.sml | 16 |
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) |