diff sql.ur @ 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 6cd839818393
line wrap: on
line diff
--- a/sql.ur	Sun Dec 11 14:04:34 2011 -0500
+++ b/sql.ur	Sun Dec 11 14:44:18 2011 -0500
@@ -29,10 +29,10 @@
 
 fun insertIfMissing [keyCols ::: {Type}] [otherCols ::: {Type}] [otherKeys ::: {{Unit}}]
                     [keyCols ~ otherCols] [[Pkey] ~ otherKeys]
+                    (kfl : folder keyCols) (kinj : $(map sql_injectable keyCols))
+                    (ofl : folder otherCols) (oinj : $(map sql_injectable otherCols))
                     (t : sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys))
                     (vs : $(keyCols ++ otherCols))
-                    (kfl : folder keyCols) (kinj : $(map sql_injectable keyCols))
-                    (ofl : folder otherCols) (oinj : $(map sql_injectable otherCols))
     : transaction bool =
     alreadyThere <- oneRowE1 (SELECT COUNT( * ) > 0
                               FROM t
@@ -46,6 +46,7 @@
 
 fun deleteByKey [keyCols ::: {Type}] [otherCols ::: {Type}] [otherKeys ::: {{Unit}}]
     [keyCols ~ otherCols] [[Pkey] ~ otherKeys]
+    (kfl : folder keyCols) (kinj : $(map sql_injectable keyCols))
     (t : sql_table (keyCols ++ otherCols) ([Pkey = map (fn _ => ()) keyCols] ++ otherKeys))
-    (vs : $keyCols) (kfl : folder keyCols) (kinj : $(map sql_injectable keyCols)) =
+    (vs : $keyCols) =
     dml (delete t (@selector [#T] ! kfl kinj vs))