summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mono_util.sml26
-rw-r--r--src/monoize.sml15
2 files changed, 21 insertions, 20 deletions
diff --git a/src/mono_util.sml b/src/mono_util.sml
index 0b2817f1..5ccaf16c 100644
--- a/src/mono_util.sml
+++ b/src/mono_util.sml
@@ -31,6 +31,8 @@ open Mono
structure S = Search
+val dummyt = (TRecord [], ErrorMsg.dummySpan)
+
structure Typ = struct
open Order
@@ -243,17 +245,19 @@ fun mapfoldB {typ = fc, exp = fe, bind} =
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
diff --git a/src/monoize.sml b/src/monoize.sml
index f5a64545..55245074 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -519,15 +519,12 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
(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,