summaryrefslogtreecommitdiff
path: root/src/mono_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 09:26:49 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 09:26:49 -0400
commit5e0563d3b00303d5053827e46811c93077455208 (patch)
tree84de1a0972562b31942273587987b2a27f615d8b /src/mono_util.sml
parent49c123050b2bc8a24f250fcc0d55e49484bc604c (diff)
First part of getting cases through monoize
Diffstat (limited to 'src/mono_util.sml')
-rw-r--r--src/mono_util.sml16
1 files changed, 16 insertions, 0 deletions
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' =>