From 768dfadfe4717b0c3f7b207a4980c78288b44a93 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 10 Jul 2008 10:11:35 -0400 Subject: page declaration, up through monoize --- src/mono_util.sml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mono_util.sml') diff --git a/src/mono_util.sml b/src/mono_util.sml index 54eb9be7..cde2d57a 100644 --- a/src/mono_util.sml +++ b/src/mono_util.sml @@ -205,6 +205,15 @@ fun mapfoldB {typ = fc, exp = fe, decl = fd, bind} = S.map2 (mfe ctx e, fn e' => (DVal (x, n, t', e'), loc))) + | DPage (xts, e) => + S.bind2 (ListUtil.mapfold (fn (x, t) => + S.map2 (mft t, + fn t' => + (x, t'))) xts, + fn xts' => + S.map2 (mfe ctx e, + fn e' => + (DPage (xts', e'), loc))) in mfd end @@ -239,10 +248,10 @@ fun mapfoldB (all as {bind, ...}) = S.bind2 (mfd ctx d, fn d' => let - val b = + val ctx' = case #1 d' of - DVal (x, n, t, e) => NamedE (x, n, t, SOME e) - val ctx' = bind (ctx, b) + DVal (x, n, t, e) => bind (ctx, NamedE (x, n, t, SOME e)) + | DPage _ => ctx in S.map2 (mff ctx' ds', fn ds' => -- cgit v1.2.3