diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-17 10:48:25 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-17 10:48:25 -0400 |
commit | 555eacbc718a0fdaa7b539ab082a4e834ca583b1 (patch) | |
tree | 0c1af34b012c448ad62c9020126a9529df9cbbc8 | |
parent | 2b4515d68b8ae071a1ee1b7febca476a94b9e77b (diff) |
Monoizing (non-mutual) 'val rec'
-rw-r--r-- | src/monoize.sml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 1d39357e..5f9e5ccd 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -248,7 +248,13 @@ fun monoDecl env (all as (d, loc)) = 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 |