diff sql.urs @ 16:959583692166

Reorder arguments for better partial application
author Adam Chlipala <adam@chlipala.net>
date Sun, 11 Dec 2011 14:44:18 -0500
parents 6ebc2ca594b7
children 875221eee987
line wrap: on
line diff
--- a/sql.urs	Sun Dec 11 14:04:34 2011 -0500
+++ b/sql.urs	Sun Dec 11 14:44:18 2011 -0500
@@ -18,16 +18,17 @@
 
 val insertIfMissing : keyCols ::: {Type} -> otherCols ::: {Type} -> otherKeys ::: {{Unit}}
                       -> [keyCols ~ otherCols] => [[Pkey] ~ otherKeys]
-                      => sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys)
+                      => folder keyCols -> $(map sql_injectable keyCols)
+                      -> folder otherCols -> $(map sql_injectable otherCols)
+                      -> sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys)
                       -> $(keyCols ++ otherCols)
-                      -> folder keyCols -> $(map sql_injectable keyCols)
-                      -> folder otherCols -> $(map sql_injectable otherCols)
                       -> transaction bool
 (* Insert a row into an SQL table if its key isn't already present, returning [False] iff the key was already present *)
 
 val deleteByKey : keyCols ::: {Type} -> otherCols ::: {Type} -> otherKeys ::: {{Unit}}
                   -> [keyCols ~ otherCols] => [[Pkey] ~ otherKeys]
-                  => sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys)
-                  -> $keyCols -> folder keyCols -> $(map sql_injectable keyCols)
+                  => folder keyCols -> $(map sql_injectable keyCols)
+                  -> sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys)
+                  -> $keyCols
                   -> transaction {}
 (* Delete a row from a table by matching its primary key against a given record. *)