Mercurial > urweb
comparison src/reduce.sml @ 955:01a4d936395a
tail example working
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 17 Sep 2009 17:11:23 -0400 |
parents | 2a50da66ffd8 |
children | 065ce3252090 |
comparison
equal
deleted
inserted
replaced
954:2a50da66ffd8 | 955:01a4d936395a |
---|---|
448 loc) | 448 loc) |
449 val e' = (EApp (e', E.liftExpInExp 0 trans3), loc) | 449 val e' = (EApp (e', E.liftExpInExp 0 trans3), loc) |
450 val e' = reassoc e' | 450 val e' = reassoc e' |
451 val e' = (EAbs ("x", dom, t2, e'), loc) | 451 val e' = (EAbs ("x", dom, t2, e'), loc) |
452 val e' = (EServerCall (n, es, e', dom, t2), loc) | 452 val e' = (EServerCall (n, es, e', dom, t2), loc) |
453 in | |
454 e' | |
455 end | |
456 | |
457 | EApp | |
458 ((EApp | |
459 ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _), | |
460 t1), | |
461 _), t2), _), | |
462 (EFfi ("Basis", "transaction_monad"), _)), _), | |
463 (ETailCall (n, es, (EAbs (_, _, _, ke), _), dom, ran), _)), _), | |
464 trans3) => | |
465 let | |
466 val e' = (EFfi ("Basis", "bind"), loc) | |
467 val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc) | |
468 val e' = (ECApp (e', dom), loc) | |
469 val e' = (ECApp (e', t2), loc) | |
470 val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc) | |
471 val e' = (EApp (e', ke), loc) | |
472 val e' = (EApp (e', E.liftExpInExp 0 trans3), loc) | |
473 val e' = reassoc e' | |
474 val e' = (EAbs ("x", dom, t2, e'), loc) | |
475 val e' = (ETailCall (n, es, e', dom, t2), loc) | |
476 in | |
477 e' | |
478 end | |
479 | |
480 | EApp | |
481 ((EApp | |
482 ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _), | |
483 t1), | |
484 _), t2), _), | |
485 (EFfi ("Basis", "transaction_monad"), _)), _), | |
486 (ETailCall (n, es, ke, dom, ran), _)), _), | |
487 trans3) => | |
488 let | |
489 val e' = (EFfi ("Basis", "bind"), loc) | |
490 val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc) | |
491 val e' = (ECApp (e', dom), loc) | |
492 val e' = (ECApp (e', t2), loc) | |
493 val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc) | |
494 val e' = (EApp (e', exp (UnknownE :: env') | |
495 (EApp (E.liftExpInExp 0 ke, (ERel 0, loc)), loc)), | |
496 loc) | |
497 val e' = (EApp (e', E.liftExpInExp 0 trans3), loc) | |
498 val e' = reassoc e' | |
499 val e' = (EAbs ("x", dom, t2, e'), loc) | |
500 val e' = (ETailCall (n, es, e', dom, t2), loc) | |
453 in | 501 in |
454 e' | 502 e' |
455 end | 503 end |
456 | 504 |
457 | EApp | 505 | EApp |