diff --git a/modules/radix/combinators.scm b/modules/radix/combinators.scm index 4332d17..b110866 100644 --- a/modules/radix/combinators.scm +++ b/modules/radix/combinators.scm @@ -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))