feat: add flip and swap combinators to (radix combinators) module
parent
43bfb6cfc9
commit
2b8f36bfa9
|
@ -6,7 +6,9 @@
|
|||
any-of
|
||||
conjoin
|
||||
disjoin
|
||||
inclusive-disjoin))
|
||||
inclusive-disjoin
|
||||
flip
|
||||
swap))
|
||||
|
||||
(define ((all-of pred) lst)
|
||||
(null? (filter (negate pred) lst)))
|
||||
|
@ -37,3 +39,8 @@
|
|||
((not (apply head-pred args)) (loop tail-preds))
|
||||
(else #f)))))
|
||||
|
||||
(define ((flip proc) . args)
|
||||
(apply proc (reverse args)))
|
||||
|
||||
(define ((swap proc) arg1 arg2 . args)
|
||||
(apply proc arg2 arg1 args))
|
||||
|
|
Loading…
Reference in New Issue