diff lib/basis.lig @ 236:f5732dc1316c

More aggregate functions
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 Aug 2008 12:56:08 -0400
parents 0608a0cfd32a
children 2b9dfaffb008
line wrap: on
line diff
--- a/lib/basis.lig	Thu Aug 28 11:59:46 2008 -0400
+++ b/lib/basis.lig	Thu Aug 28 12:56:08 2008 -0400
@@ -121,13 +121,30 @@
 val sql_ge : sql_comparison
 val sql_comparison : sql_comparison
         -> tables ::: {{Type}} -> agg ::: {{Type}} -> exps ::: {Type}
-        -> t ::: Type -> sql_injectable t
+        -> t ::: Type
         -> sql_exp tables agg exps t -> sql_exp tables agg exps t
         -> sql_exp tables agg exps bool
 
 val sql_count : tables ::: {{Type}} -> agg ::: {{Type}} -> exps ::: {Type}
         -> unit -> sql_exp tables agg exps int
 
+con sql_aggregate :: Type -> Type
+val sql_aggregate : tables ::: {{Type}} -> agg ::: {{Type}} -> exps ::: {Type} -> t ::: Type
+        -> sql_aggregate t -> sql_exp agg agg exps t -> sql_exp tables agg exps t
+
+class sql_summable
+val sql_summable_int : sql_summable int
+val sql_summable_float : sql_summable float
+val sql_avg : t ::: Type -> sql_summable t -> sql_aggregate t
+val sql_sum : t ::: Type -> sql_summable t -> sql_aggregate t
+
+class sql_maxable
+val sql_maxable_int : sql_maxable int
+val sql_maxable_float : sql_maxable float
+val sql_maxable_string : sql_maxable string
+val sql_max : t ::: Type -> sql_maxable t -> sql_aggregate t
+val sql_min : t ::: Type -> sql_maxable t -> sql_aggregate t
+
 
 (** XML *)