summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-05 11:48:55 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-05 11:48:55 -0400
commitf6559c7555465c479d45529748deb8c15dfa346c (patch)
treeaffa61639daa2a14b7eb6c9f8bb56617fa62582c /lib
parent37eeae6bc2503281d1b806c85aa0e70645fd9966 (diff)
Chat demo
Diffstat (limited to 'lib')
-rw-r--r--lib/ur/top.ur26
-rw-r--r--lib/ur/top.urs11
2 files changed, 0 insertions, 37 deletions
diff --git a/lib/ur/top.ur b/lib/ur/top.ur
index 154e88e9..b9728158 100644
--- a/lib/ur/top.ur
+++ b/lib/ur/top.ur
@@ -196,29 +196,3 @@ fun eqNullable' (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type})
case e2 of
None => (SQL {e1} IS NULL)
| Some _ => sql_binary sql_eq e1 (sql_inject e2)
-
-
-functor Broadcast(M : sig type t end) = struct
- sequence s
- table t : {Id : int, Client : client, Channel : channel M.t}
-
- type topic = int
-
- val inj : sql_injectable topic = _
-
- val create = nextval s
-
- fun subscribe id =
- cli <- self;
- ro <- oneOrNoRows (SELECT t.Channel FROM t WHERE t.Id = {[id]} AND t.Client = {[cli]});
- case ro of
- None =>
- ch <- channel;
- dml (INSERT INTO t (Id, Client, Channel) VALUES ({[id]}, {[cli]}, {[ch]}));
- return ch
- | Some r => return r.T.Channel
-
- fun send id msg =
- queryI (SELECT t.Channel FROM t WHERE t.Id = {[id]})
- (fn r => Basis.send r.T.Channel msg)
-end
diff --git a/lib/ur/top.urs b/lib/ur/top.urs
index 821aa42a..60b6dac2 100644
--- a/lib/ur/top.urs
+++ b/lib/ur/top.urs
@@ -134,14 +134,3 @@ val eqNullable' : tables ::: {{Type}} -> agg ::: {{Type}} -> exps ::: {Type}
-> sql_exp tables agg exps (option t)
-> option t
-> sql_exp tables agg exps bool
-
-
-functor Broadcast(M : sig type t end) : sig
- type topic
-
- val inj : sql_injectable topic
-
- val create : transaction topic
- val subscribe : topic -> transaction (channel M.t)
- val send : topic -> M.t -> transaction unit
-end