From 5e0563d3b00303d5053827e46811c93077455208 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 3 Aug 2008 09:26:49 -0400 Subject: First part of getting cases through monoize --- src/mono_util.sml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mono_util.sml') diff --git a/src/mono_util.sml b/src/mono_util.sml index a75a0c31..970f3fa0 100644 --- a/src/mono_util.sml +++ b/src/mono_util.sml @@ -141,6 +141,11 @@ fun mapfoldB {typ = fc, exp = fe, bind} = EPrim _ => S.return2 eAll | ERel _ => S.return2 eAll | ENamed _ => S.return2 eAll + | ECon (_, NONE) => S.return2 eAll + | ECon (n, SOME e) => + S.map2 (mfe ctx e, + fn e' => + (ECon (n, SOME e'), loc)) | EFfi _ => S.return2 eAll | EFfiApp (m, x, es) => S.map2 (ListUtil.mapfold (fn e => mfe ctx e) es, @@ -176,6 +181,17 @@ fun mapfoldB {typ = fc, exp = fe, bind} = fn e' => (EField (e', x), loc)) + | ECase (e, pes, t) => + S.bind2 (mfe ctx e, + fn e' => + S.bind2 (ListUtil.mapfold (fn (p, e) => + S.map2 (mfe ctx e, + fn e' => (p, e'))) pes, + fn pes' => + S.map2 (mft t, + fn t' => + (ECase (e', pes', t'), loc)))) + | EStrcat (e1, e2) => S.bind2 (mfe ctx e1, fn e1' => -- cgit v1.2.3