feat: add the partial combinator to the (radix combinators) module
parent
64d5e3a6e7
commit
1ce6f074bd
|
@ -8,6 +8,7 @@
|
||||||
disjoin
|
disjoin
|
||||||
inclusive-disjoin
|
inclusive-disjoin
|
||||||
flip
|
flip
|
||||||
|
partial
|
||||||
swap))
|
swap))
|
||||||
|
|
||||||
(define ((all-of pred) lst)
|
(define ((all-of pred) lst)
|
||||||
|
@ -39,6 +40,9 @@
|
||||||
((not (apply head-pred args)) (loop tail-preds))
|
((not (apply head-pred args)) (loop tail-preds))
|
||||||
(else #f)))))
|
(else #f)))))
|
||||||
|
|
||||||
|
(define ((partial proc . args) . more-args)
|
||||||
|
(apply proc (append args more-args)))
|
||||||
|
|
||||||
(define ((flip proc) . args)
|
(define ((flip proc) . args)
|
||||||
(apply proc (reverse args)))
|
(apply proc (reverse args)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue