aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-02-14 14:07:56 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-02-14 14:07:56 -0500
commitf7db36644bdbde7b0ed48daffeb760bd5418bd2e (patch)
treed009d124587d5ea580081e4d2fccfb6ac9c21d69 /src/core_util.sml
parentf75d359eeaaca5884d515380b735826532fad15c (diff)
Start of RPCification
Diffstat (limited to 'src/core_util.sml')
-rw-r--r--src/core_util.sml14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core_util.sml b/src/core_util.sml
index 02cb86ca..3d6808f9 100644
--- a/src/core_util.sml
+++ b/src/core_util.sml
@@ -479,6 +479,13 @@ fun compare ((e1, _), (e2, _)) =
| (ELet (_, _, x1, e1), ELet (_, _, x2, e2)) =>
join (compare (x1, x2),
fn () => compare (e1, e2))
+ | (ELet _, _) => LESS
+ | (_, ELet _) => GREATER
+
+ | (EServerCall (n1, es1, e1), EServerCall (n2, es2, e2)) =>
+ join (Int.compare (n1, n2),
+ fn () => join (joinL compare (es1, es2),
+ fn () => compare (e1, e2)))
datatype binder =
RelC of string * kind
@@ -653,6 +660,13 @@ fun mapfoldB {kind = fk, con = fc, exp = fe, bind} =
fn e2' =>
(ELet (x, t', e1', e2'), loc))))
+ | EServerCall (n, es, e) =>
+ S.bind2 (ListUtil.mapfold (mfe ctx) es,
+ fn es' =>
+ S.map2 (mfe ctx e,
+ fn e' =>
+ (EServerCall (n, es', e'), loc)))
+
and mfp ctx (pAll as (p, loc)) =
case p of
PWild => S.return2 pAll