aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/expl_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 12:43:20 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 12:43:20 -0400
commit6314b4c27a14576b356258dad74607168135cb51 (patch)
treeec853f9102b3d3e5729457db7a10fd4f81165431 /src/expl_util.sml
parent1798f5eb1b11613d88acb307472922976f1583b4 (diff)
Compiled pattern matching to C
Diffstat (limited to 'src/expl_util.sml')
-rw-r--r--src/expl_util.sml10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/expl_util.sml b/src/expl_util.sml
index 685605c3..290c64f5 100644
--- a/src/expl_util.sml
+++ b/src/expl_util.sml
@@ -287,16 +287,18 @@ fun mapfoldB {kind = fk, con = fc, exp = fe, bind} =
fn e' =>
(EWrite e', loc))
- | ECase (e, pes, t) =>
+ | ECase (e, pes, {disc, result}) =>
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))))
+ S.bind2 (mfc ctx disc,
+ fn disc' =>
+ S.map2 (mfc ctx result,
+ fn result' =>
+ (ECase (e', pes', {disc = disc', result = result'}), loc)))))
in
mfe
end