diff options
| author | Jakob L. Kreuze | 2023-05-03 10:46:34 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2023-05-03 10:46:34 -0400 |
| commit | 62440c0d5b99ee925045158d22a69f51607ab601 (patch) | |
| tree | 6d53c7220dd01e7ca043f98c4b037fc61eab043f | |
| parent | 725d02db071b79ab9007fdd9c38656b3eedd8edf (diff) | |
Fix issue of policy-map dropping rules
| -rw-r--r-- | compiler/types.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/types.scm b/compiler/types.scm index 83ae370..d3ee3dc 100644 --- a/compiler/types.scm +++ b/compiler/types.scm @@ -78,10 +78,12 @@ (define (policy-map policy f) (over (ι-policy-rules) - (lambda (rules) - (zip (map car rules) - ;; n.b. discards `scope', `breadcrumb' - (map (compose (cut tree-map <> f (scope policy) '()) cadr) rules))) + (lambda (rule-groups) + (map (match-lambda + ((group-head rules ...) + `(,group-head + ,@(map (compose (cut tree-map <> f (scope policy) '())) rules)))) + rule-groups)) policy)) (define-method (tree-map form f scope breadcrumb) |