changeset 267:f31e8da68e90

Changed EQuery not to use a function in its body
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 16:32:49 -0400
parents 7a7efbb3e354
children bacd0ba869e1
files src/mono_util.sml src/monoize.sml
diffstat 2 files changed, 21 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/mono_util.sml	Sun Aug 31 16:26:50 2008 -0400
+++ b/src/mono_util.sml	Sun Aug 31 16:32:49 2008 -0400
@@ -31,6 +31,8 @@
 
 structure S = Search
 
+val dummyt = (TRecord [], ErrorMsg.dummySpan)
+
 structure Typ = struct
 
 open Order
@@ -243,17 +245,19 @@
                                               fn state' =>
                                                  S.bind2 (mfe ctx query,
                                                           fn query' =>
-                                                             S.bind2 (mfe ctx body,
-                                                                     fn body' =>
-                                                                        S.map2 (mfe ctx initial,
-                                                                                fn initial' =>
-                                                                                   (EQuery {exps = exps',
-                                                                                            tables = tables',
-                                                                                            state = state',
-                                                                                            query = query',
-                                                                                            body = body',
-                                                                                            initial = initial'},
-                                                                                    loc)))))))
+                                                             S.bind2 (mfe (bind (bind (ctx, RelE ("r", dummyt)),
+                                                                                 RelE ("acc", dummyt)))
+                                                                          body,
+                                                                   fn body' =>
+                                                                      S.map2 (mfe ctx initial,
+                                                                           fn initial' =>
+                                                                              (EQuery {exps = exps',
+                                                                                       tables = tables',
+                                                                                       state = state',
+                                                                                       query = query',
+                                                                                       body = body',
+                                                                                       initial = initial'},
+                                                                               loc)))))))
     in
         mfe
     end
--- a/src/monoize.sml	Sun Aug 31 16:26:50 2008 -0400
+++ b/src/monoize.sml	Sun Aug 31 16:32:49 2008 -0400
@@ -519,15 +519,12 @@
                                                           (L'.TFun (un, state), loc)),
                                                  loc)), loc)
 
-                             val body' = (L'.EAbs ("r", (L'.TRecord rt, loc),
-                                                   (L'.TFun (state, state), loc),
-                                                   (L'.EAbs ("acc", state, state,
-                                                             (L'.EApp (
-                                                              (L'.EApp (
-                                                               (L'.EApp ((L'.ERel 4, loc),
-                                                                         (L'.ERel 1, loc)), loc),
-                                                               (L'.ERel 0, loc)), loc),
-                                                              (L'.ERecord [], loc)), loc)), loc)), loc)
+                             val body' = (L'.EApp (
+                                          (L'.EApp (
+                                           (L'.EApp ((L'.ERel 4, loc),
+                                                     (L'.ERel 1, loc)), loc),
+                                           (L'.ERel 0, loc)), loc),
+                                          (L'.ERecord [], loc)), loc)
 
                              val body = (L'.EQuery {exps = exps,
                                                     tables = tables,