summaryrefslogtreecommitdiff
path: root/src/elab_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 10:06:27 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 10:06:27 -0400
commitf4351288c5b57b130c0a75e5e84a445ca513527f (patch)
treec0e69cdf2d843fbf3c5d2853ce2effe487090970 /src/elab_util.sml
parentaa1b3a24913edd0dc97af0d1fc9e3dc0026a2460 (diff)
Elaborating some basic pattern matching
Diffstat (limited to 'src/elab_util.sml')
-rw-r--r--src/elab_util.sml11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/elab_util.sml b/src/elab_util.sml
index 05f80ad1..ac2e1a99 100644
--- a/src/elab_util.sml
+++ b/src/elab_util.sml
@@ -308,6 +308,17 @@ fun mapfoldB {kind = fk, con = fc, exp = fe, bind} =
fn k' =>
(EFold k', 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 (mfc ctx t,
+ fn t' =>
+ (ECase (e', pes', t'), loc))))
+
| EError => S.return2 eAll
in
mfe