We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 932d3d0 commit 5c840e0Copy full SHA for 5c840e0
lib/core/order.egi
@@ -36,12 +36,12 @@
36
(if (gt? x y) x y)))
37
38
(define $min/fn
39
- (lambda [$compare $x $y]
40
- (if (eq? (compare x y) <Less>) x y)))
+ (lambda [$f $xs]
+ (foldl 2#(if (eq? (f %1 %2) <Less>) %1 %2) (car xs) (cdr xs))))
41
42
(define $max/fn
43
44
- (if (eq? (compare x y) <Greater>) x y)))
+ (foldl 2#(if (eq? (f %1 %2) <Greater>) %1 %2) (car xs) (cdr xs))))
45
46
(define $min (cambda $xs (foldl b.min (car xs) (cdr xs))))
47
(define $max (cambda $xs (foldl b.max (car xs) (cdr xs))))
0 commit comments