diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-05 11:48:55 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-05 11:48:55 -0400 |
commit | 3b3f14a1c2021f307e9290ec8fba64d6c791a93a (patch) | |
tree | affa61639daa2a14b7eb6c9f8bb56617fa62582c /lib | |
parent | a44e147bbb6686867b425b7cf068d14c5f230f51 (diff) |
Chat demo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ur/top.ur | 26 | ||||
-rw-r--r-- | lib/ur/top.urs | 11 |
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 |