diff lib/ur/top.urs @ 1076:dcf98ae3c48d

Allow same constructor shorthand for 'view' sig items as for 'table'
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Dec 2009 11:11:49 -0500
parents d89f98f0b4bb
children 25d491287358
line wrap: on
line diff
--- a/lib/ur/top.urs	Tue Dec 15 10:19:05 2009 -0500
+++ b/lib/ur/top.urs	Tue Dec 15 11:11:49 2009 -0500
@@ -132,6 +132,11 @@
                  -> xml ctx inp [])
              -> transaction (xml ctx inp [])
 
+val queryX1 : nm ::: Name -> fs ::: {Type} -> ctx ::: {Unit} -> inp ::: {Type}
+              -> sql_query [nm = fs] []
+              -> ($fs -> xml ctx inp [])
+              -> transaction (xml ctx inp [])
+
 val queryX' : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} -> inp ::: {Type}
               -> [tables ~ exps] =>
               sql_query tables exps
@@ -156,9 +161,9 @@
                    -> sql_query [nm = fs] []
                    -> transaction (option $fs)
 
-val oneOrNoRowsE1 : tab ::: Name -> nm ::: Name -> t ::: Type
-                    -> [[tab] ~ [nm]] =>
-    sql_query [tab = []] [nm = t]
+val oneOrNoRowsE1 : tabs ::: {Unit} -> nm ::: Name -> t ::: Type
+                    -> [tabs ~ [nm]] =>
+    sql_query (mapU [] tabs) [nm = t]
     -> transaction (option t)
 
 val oneRow : tables ::: {{Type}} -> exps ::: {Type}
@@ -168,6 +173,10 @@
                     $(exps
                           ++ map (fn fields :: {Type} => $fields) tables)
 
+val oneRow1 : nm ::: Name -> fs ::: {Type}
+    -> sql_query [nm = fs] []
+    -> transaction $fs
+
 val oneRowE1 : tabs ::: {Unit} -> nm ::: Name -> t ::: Type
                -> [tabs ~ [nm]] =>
     sql_query (mapU [] tabs) [nm = t]