feat: add the partial combinator to the (radix combinators) module

pull/1/head
anemofilia 2023-09-28 21:19:10 -03:00
parent 64d5e3a6e7
commit 1ce6f074bd
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
1 changed files with 4 additions and 0 deletions

View File

@ -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)))