# HG changeset patch # User Adam Chlipala # Date 1216306105 14400 # Node ID b04f7422c832f881321c940e6679169885f2f561 # Parent 4eb68ed311450161ea90464372a758f425237511 Monoizing (non-mutual) 'val rec' diff -r 4eb68ed31145 -r b04f7422c832 src/monoize.sml --- a/src/monoize.sml Thu Jul 17 10:43:16 2008 -0400 +++ b/src/monoize.sml Thu Jul 17 10:48:25 2008 -0400 @@ -248,7 +248,13 @@ L.DCon _ => NONE | L.DVal (x, n, t, e, s) => SOME (Env.pushENamed env x n t (SOME e) s, (L'.DVal (x, n, monoType env t, monoExp env e, s), loc)) - | L.DValRec _ => raise Fail "Monoize DValRec" + | L.DValRec vis => + let + val env = foldl (fn ((x, n, t, e, s), env) => Env.pushENamed env x n t NONE s) env vis + in + SOME (env, + (L'.DValRec (map (fn (x, n, t, e, s) => (x, n, monoType env t, monoExp env e, s)) vis), loc)) + end | L.DExport n => let val (_, t, _, s) = Env.lookupENamed env n