comparison src/core_util.sml @ 609:56aaa1941dad

First gimpy RPC
author Adam Chlipala <adamc@hcoop.net>
date Sun, 15 Feb 2009 10:32:50 -0500
parents 0dd40b6bfdf3
children 8998114760c1
comparison
equal deleted inserted replaced
608:330a7de47914 609:56aaa1941dad
480 join (compare (x1, x2), 480 join (compare (x1, x2),
481 fn () => compare (e1, e2)) 481 fn () => compare (e1, e2))
482 | (ELet _, _) => LESS 482 | (ELet _, _) => LESS
483 | (_, ELet _) => GREATER 483 | (_, ELet _) => GREATER
484 484
485 | (EServerCall (n1, es1, e1), EServerCall (n2, es2, e2)) => 485 | (EServerCall (n1, es1, e1, _), EServerCall (n2, es2, e2, _)) =>
486 join (Int.compare (n1, n2), 486 join (Int.compare (n1, n2),
487 fn () => join (joinL compare (es1, es2), 487 fn () => join (joinL compare (es1, es2),
488 fn () => compare (e1, e2))) 488 fn () => compare (e1, e2)))
489 489
490 datatype binder = 490 datatype binder =
658 fn e1' => 658 fn e1' =>
659 S.map2 (mfe (bind (ctx, RelE (x, t'))) e2, 659 S.map2 (mfe (bind (ctx, RelE (x, t'))) e2,
660 fn e2' => 660 fn e2' =>
661 (ELet (x, t', e1', e2'), loc)))) 661 (ELet (x, t', e1', e2'), loc))))
662 662
663 | EServerCall (n, es, e) => 663 | EServerCall (n, es, e, t) =>
664 S.bind2 (ListUtil.mapfold (mfe ctx) es, 664 S.bind2 (ListUtil.mapfold (mfe ctx) es,
665 fn es' => 665 fn es' =>
666 S.map2 (mfe ctx e, 666 S.bind2 (mfe ctx e,
667 fn e' => 667 fn e' =>
668 (EServerCall (n, es', e'), loc))) 668 S.map2 (mfc ctx t,
669 fn t' =>
670 (EServerCall (n, es', e', t'), loc))))
669 671
670 and mfp ctx (pAll as (p, loc)) = 672 and mfp ctx (pAll as (p, loc)) =
671 case p of 673 case p of
672 PWild => S.return2 pAll 674 PWild => S.return2 pAll
673 | PVar (x, t) => 675 | PVar (x, t) =>