> Actually, MIN still is fundamentally a first-order itself. The dyadic > function call "x min y" returns either x or y depending on how they compare. > The list form is then repeated application of the binary min(). This is > directly comparable to your example of list plus/sum which is repetition of > the dyadic "x + y".
1. An ordered data type is one that implements "less than". Other comparisons (LE,GT,GE) are then implemented generically (all data types implement EQ). 2. Yes, MIN(x,y) or x MIN y is a first-order function as described that is well-defined on any ordered data type, and can also be implemented generically using LT. 3. [and BTW MAX(x,y) can also be implemented generically on any ordered type, using LT.] 4. The aggregation function MIN(X) of SQL is a second order function, equivalent to FOLD(MIN,X). That is, the function repeatedly applies the MIN function to pairs of values and returns a single value. 5. All aggregation functions (whether defined in SQL or elsewhere) rely on second order functions of the form FOLD(F,X) where F is the function to be repeatedly applied. Andl implements them as such, with complete genericity. 6. [COUNT is also a second order function, equivalent to FOLD(+,1).] > List MIN is NOT a repeated application of "x less than y". -- Agreed, see above. Regards David M Bennett FACS Andl - A New Database Language - andl.org