diff src/expl_util.sml @ 176:33d4a8eea484

Case through explify
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 16:28:55 -0400
parents 06a98129b23f
children d11754ffe252
line wrap: on
line diff
--- a/src/expl_util.sml	Thu Jul 31 13:08:57 2008 -0400
+++ b/src/expl_util.sml	Thu Jul 31 16:28:55 2008 -0400
@@ -286,6 +286,17 @@
                 S.map2 (mfe ctx e,
                      fn e' =>
                         (EWrite e', 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))))
     in
         mfe
     end