diff src/rpcify.sml @ 955:01a4d936395a

tail example working
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Sep 2009 17:11:23 -0400
parents 2a50da66ffd8
children d80734855790
line wrap: on
line diff
--- a/src/rpcify.sml	Thu Sep 17 16:35:11 2009 -0400
+++ b/src/rpcify.sml	Thu Sep 17 17:11:23 2009 -0400
@@ -259,7 +259,12 @@
                                                                              (fn (i, _) =>
                                                                                  (ERel (len - i - 1), loc))
                                                                              ts
-                                                              val k = (EAbs ("x", ran, ran, (ERel 0, loc)), loc)
+                                                              val k = (EFfi ("Basis", "return"), loc)
+                                                              val trans = (CFfi ("Basis", "transaction"), loc)
+                                                              val k = (ECApp (k, trans), loc)
+                                                              val k = (ECApp (k, ran), loc)
+                                                              val k = (EApp (k, (EFfi ("Basis", "transaction_monad"),
+                                                                                 loc)), loc)
                                                               val re = (ETailCall (n, args, k, ran, ran), loc)
                                                               val (re, _) = foldr (fn (dom, (re, ran)) =>
                                                                                       ((EAbs ("x", dom, ran, re),
@@ -273,7 +278,6 @@
                                                                                (EApp (be, (ERel (len - i), loc)), loc))
                                                                            be ts
                                                               val ne = (EFfi ("Basis", "bind"), loc)
-                                                              val trans = (CFfi ("Basis", "transaction"), loc)
                                                               val ne = (ECApp (ne, trans), loc)
                                                               val ne = (ECApp (ne, ran), loc)
                                                               val unit = (TRecord (CRecord ((KType, loc), []),