From 1ce6f074bdd396cbc1538f7caf81c195857e1728 Mon Sep 17 00:00:00 2001 From: anemofilia Date: Thu, 28 Sep 2023 21:19:10 -0300 Subject: [PATCH] feat: add the partial combinator to the (radix combinators) module --- modules/radix/combinators.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/radix/combinators.scm b/modules/radix/combinators.scm index b110866..aef7661 100644 --- a/modules/radix/combinators.scm +++ b/modules/radix/combinators.scm @@ -8,6 +8,7 @@ disjoin inclusive-disjoin flip + partial swap)) (define ((all-of pred) lst) @@ -39,6 +40,9 @@ ((not (apply head-pred args)) (loop tail-preds)) (else #f))))) +(define ((partial proc . args) . more-args) + (apply proc (append args more-args))) + (define ((flip proc) . args) (apply proc (reverse args)))