comparison 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
comparison
equal deleted inserted replaced
167:2be573fec9a6 168:25b169416ea8
82 sm xts 82 sm xts
83 val (sm, si) = Sm.find (sm, old_xts, xts) 83 val (sm, si) = Sm.find (sm, old_xts, xts)
84 in 84 in
85 ((L'.TRecord si, loc), sm) 85 ((L'.TRecord si, loc), sm)
86 end 86 end
87 | L.TNamed n => ((L'.TDatatype n, loc), sm) 87 | L.TDatatype (n, xncs) =>
88 let
89 val (xncs, sm) = ListUtil.foldlMap (fn ((x, n, to), sm) =>
90 case to of
91 NONE => ((x, n, NONE), sm)
92 | SOME t =>
93 let
94 val (t, sm) = cifyTyp (t, sm)
95 in
96 ((x, n, SOME t), sm)
97 end)
98 sm xncs
99 in
100 ((L'.TDatatype (n, xncs), loc), sm)
101 end
88 | L.TFfi mx => ((L'.TFfi mx, loc), sm) 102 | L.TFfi mx => ((L'.TFfi mx, loc), sm)
89 103
90 val dummye = (L'.EPrim (Prim.Int 0), ErrorMsg.dummySpan) 104 val dummye = (L'.EPrim (Prim.Int 0), ErrorMsg.dummySpan)
91 105
92 fun cifyExp ((e, loc), sm) = 106 fun cifyExp ((e, loc), sm) =