changeset 575:9f02f1765149

Starting to implement source set
author Adam Chlipala <adamc@hcoop.net>
date Tue, 30 Dec 2008 09:43:41 -0500
parents ac947e2f29ff
children 813f1e78d9d0
files lib/basis.urs src/monoize.sml
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/basis.urs	Sun Dec 21 12:56:39 2008 -0500
+++ b/lib/basis.urs	Tue Dec 30 09:43:41 2008 -0500
@@ -85,6 +85,7 @@
 
 con source :: Type -> Type
 val source : t ::: Type -> t -> transaction (source t)
+val set : t ::: Type -> source t -> t -> transaction unit
 
 con signal :: Type -> Type
 val signal_monad : monad signal
--- a/src/monoize.sml	Sun Dec 21 12:56:39 2008 -0500
+++ b/src/monoize.sml	Tue Dec 30 09:43:41 2008 -0500
@@ -979,6 +979,19 @@
                   loc),
                  fm)
             end
+          | L.ECApp ((L.EFfi ("Basis", "set"), _), t) =>
+            let
+                val t = monoType env t
+            in
+                ((L'.EAbs ("src", (L'.TFfi ("Basis", "int"), loc),
+                           (L'.TFun (t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc)), loc),
+                           (L'.EAbs ("v", t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc),
+                                     (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TRecord [], loc),
+                                               (L'.EFfiApp ("Basis", "set_client_source",
+                                                            [(L'.ERel 2, loc), (L'.ERel 1, loc)]),
+                                                loc)), loc)), loc)), loc),
+                 fm)
+            end
 
           | L.EApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "return"), _), _), _), t), _),
                     (L.EFfi ("Basis", "signal_monad"), _)) =>