Mercurial > urweb
comparison src/core_util.sml @ 607:0dd40b6bfdf3
Start of RPCification
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 14 Feb 2009 14:07:56 -0500 |
parents | 3162bbf8e30f |
children | 56aaa1941dad |
comparison
equal
deleted
inserted
replaced
606:5145181b02fa | 607:0dd40b6bfdf3 |
---|---|
477 | (_, EClosure _) => GREATER | 477 | (_, EClosure _) => GREATER |
478 | 478 |
479 | (ELet (_, _, x1, e1), ELet (_, _, x2, e2)) => | 479 | (ELet (_, _, x1, e1), ELet (_, _, x2, e2)) => |
480 join (compare (x1, x2), | 480 join (compare (x1, x2), |
481 fn () => compare (e1, e2)) | 481 fn () => compare (e1, e2)) |
482 | (ELet _, _) => LESS | |
483 | (_, ELet _) => GREATER | |
484 | |
485 | (EServerCall (n1, es1, e1), EServerCall (n2, es2, e2)) => | |
486 join (Int.compare (n1, n2), | |
487 fn () => join (joinL compare (es1, es2), | |
488 fn () => compare (e1, e2))) | |
482 | 489 |
483 datatype binder = | 490 datatype binder = |
484 RelC of string * kind | 491 RelC of string * kind |
485 | NamedC of string * int * kind * con option | 492 | NamedC of string * int * kind * con option |
486 | RelE of string * con | 493 | RelE of string * con |
651 fn e1' => | 658 fn e1' => |
652 S.map2 (mfe (bind (ctx, RelE (x, t'))) e2, | 659 S.map2 (mfe (bind (ctx, RelE (x, t'))) e2, |
653 fn e2' => | 660 fn e2' => |
654 (ELet (x, t', e1', e2'), loc)))) | 661 (ELet (x, t', e1', e2'), loc)))) |
655 | 662 |
663 | EServerCall (n, es, e) => | |
664 S.bind2 (ListUtil.mapfold (mfe ctx) es, | |
665 fn es' => | |
666 S.map2 (mfe ctx e, | |
667 fn e' => | |
668 (EServerCall (n, es', e'), loc))) | |
669 | |
656 and mfp ctx (pAll as (p, loc)) = | 670 and mfp ctx (pAll as (p, loc)) = |
657 case p of | 671 case p of |
658 PWild => S.return2 pAll | 672 PWild => S.return2 pAll |
659 | PVar (x, t) => | 673 | PVar (x, t) => |
660 S.map2 (mfc ctx t, | 674 S.map2 (mfc ctx t, |