changeset 72:0ee10f4d73cf

Explify efold
author Adam Chlipala <adamc@hcoop.net>
date Thu, 26 Jun 2008 11:11:13 -0400
parents 6431b315a1e3
children 8b611ecc5f2d
files src/corify.sml src/elab_print.sml src/expl.sml src/expl_print.sml src/expl_util.sml src/explify.sml
diffstat 6 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/corify.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/corify.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -299,6 +299,7 @@
       | L.ERecord xes => (L'.ERecord (map (fn (c, e, t) => (corifyCon st c, corifyExp st e, corifyCon st t)) xes), loc)
       | L.EField (e1, c, {field, rest}) => (L'.EField (corifyExp st e1, corifyCon st c,
                                                        {field = corifyCon st field, rest = corifyCon st rest}), loc)
+      | L.EFold _ => raise Fail "Corify EFold"
 
 fun corifyDecl ((d, loc : EM.span), st) =
     case d of
--- a/src/elab_print.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/elab_print.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -249,7 +249,7 @@
             box [p_exp' true env e,
                  string ".",
                  p_con' true env c]
-      | EFold _ => string "fold"            
+      | EFold _ => string "fold"
 
       | EError => string "<ERROR>"
 
--- a/src/expl.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/expl.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -68,6 +68,7 @@
 
        | ERecord of (con * exp * con) list
        | EField of exp * con * { field : con, rest : con }
+       | EFold of kind
 
 withtype exp = exp' located
 
--- a/src/expl_print.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/expl_print.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -233,6 +233,7 @@
             box [p_exp' true env e,
                  string ".",
                  p_con' true env c]
+      | EFold _ => string "fold"
 
 and p_exp env = p_exp' false env
 
--- a/src/expl_util.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/expl_util.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -263,6 +263,10 @@
                                              S.map2 (mfc ctx rest,
                                                   fn rest' =>
                                                      (EField (e', c', {field = field', rest = rest'}), loc)))))
+              | EFold k =>
+                S.map2 (mfk k,
+                         fn k' =>
+                            (EFold k', loc))
     in
         mfe
     end
--- a/src/explify.sml	Thu Jun 26 11:09:30 2008 -0400
+++ b/src/explify.sml	Thu Jun 26 11:11:13 2008 -0400
@@ -79,7 +79,7 @@
       | L.ERecord xes => (L'.ERecord (map (fn (c, e, t) => (explifyCon c, explifyExp e, explifyCon t)) xes), loc)
       | L.EField (e1, c, {field, rest}) => (L'.EField (explifyExp e1, explifyCon c,
                                                        {field = explifyCon field, rest = explifyCon rest}), loc)
-      | L.EFold _ => raise Fail "Explify EFold"
+      | L.EFold k => (L'.EFold (explifyKind k), loc)
 
       | L.EError => raise Fail ("explifyExp: EError at " ^ EM.spanToString loc)