From cf49a6f0870013803a5e1d3dda03fd154f91244c Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Fri, 22 Apr 2022 14:39:57 +0200 Subject: [PATCH] Add apply-op as a parameter to make-tabulate*. --- functions.rkt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.rkt b/functions.rkt index cee1160..ed2ee21 100644 --- a/functions.rkt +++ b/functions.rkt @@ -84,15 +84,15 @@ (check-false (g #t #f)) (check-exn exn:fail? (λ () (g #t #f #f)))) - (define-syntax-parse-rule (make-tabulate* name:id row-op:id) + (define-syntax-parse-rule (make-tabulate* name:id row-op:id apply-op:id) (define (name funcs doms) (for/list ([xs (in-list (apply cartesian-product doms))]) (row-op xs (for/list ([f funcs]) : (Listof b) - (apply f xs)))))) + (apply-op f xs)))))) (: tabulate* (All (b a ... ) (-> (Listof (-> a ... b)) (List (Listof a) ... a) (Listof (Listof (U Any b)))))) - (make-tabulate* tabulate* append) + (make-tabulate* tabulate* append apply) (module+ test (test-case "tabulate*" @@ -106,7 +106,7 @@ (: tabulate*/strict (All (b a ...) (-> (Listof (-> a ... b)) (List (Listof a) ... a) (Listof (List (List a ...) (Listof b)))))) - (make-tabulate* tabulate*/strict list) + (make-tabulate* tabulate*/strict list apply) (module+ test (test-case "tabulate*/strict" @@ -119,7 +119,7 @@ (: tabulate*/pv (All (a b) (-> (Listof (-> a * b)) (Listof (Listof a)) (Listof (Listof (U a b)))))) - (make-tabulate* tabulate*/pv append) + (make-tabulate* tabulate*/pv append apply) (module+ test (test-case "tabulate*/pv"