From f7db36644bdbde7b0ed48daffeb760bd5418bd2e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 14 Feb 2009 14:07:56 -0500 Subject: Start of RPCification --- src/core_util.sml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core_util.sml') 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 -- cgit v1.2.3