comparison src/monoize.sml @ 109:813e5a52063d

Remove closure conversion in favor of zany fun with modules, which also replaces 'page'
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 10:17:06 -0400
parents d101cb1efe55
children 3739af9e727a
comparison
equal deleted inserted replaced
108:f59553dc1b6a 109:813e5a52063d
201 Print.eprefaces' [("Declaration", CorePrint.p_decl env all)]; 201 Print.eprefaces' [("Declaration", CorePrint.p_decl env all)];
202 NONE) 202 NONE)
203 in 203 in
204 case d of 204 case d of
205 L.DCon _ => NONE 205 L.DCon _ => NONE
206 | L.DVal (x, n, t, e) => SOME (Env.pushENamed env x n t (SOME e), 206 | L.DVal (x, n, t, e, s) => SOME (Env.pushENamed env x n t (SOME e) s,
207 (L'.DVal (x, n, monoType env t, monoExp env e), loc)) 207 (L'.DVal (x, n, monoType env t, monoExp env e, s), loc))
208 | L.DPage ((c, _), e) => 208 | L.DExport n => SOME (env, (L'.DExport n, loc))
209 (case c of
210 L.CRecord (_, vs) => SOME (env,
211 (L'.DPage (map (fn (nm, t) => (monoName env nm,
212 monoType env t)) vs,
213 monoExp env e), loc))
214 | _ => poly ())
215 end 209 end
216 210
217 fun monoize env ds = 211 fun monoize env ds =
218 let 212 let
219 val (_, ds) = List.foldl (fn (d, (env, ds)) => 213 val (_, ds) = List.foldl (fn (d, (env, ds)) =>