From 1337ab25adc3a5e89c61108bf11e86e71e47c861 Mon Sep 17 00:00:00 2001 From: jgart Date: Thu, 12 Feb 2026 12:06:02 -0500 Subject: [PATCH] home: services: sway: Refactor flatmap to append-map. * gnu/home/services/sway.scm (flatmap): Refactor flatmap to append-map. Change-Id: I1a8e46ac7f2de163bc33f4bf61f267d35893cfc2 Signed-off-by: jgart --- gnu/home/services/sway.scm | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/gnu/home/services/sway.scm b/gnu/home/services/sway.scm index e9a488f1ca..a2d13e7720 100644 --- a/gnu/home/services/sway.scm +++ b/gnu/home/services/sway.scm @@ -102,18 +102,6 @@ ;; Convenient value to inherit for extensions. %empty-sway-configuration)) -;; Helper function. -(define (flatmap f l) - (let loop ((lst (reverse l)) - (acc '())) - (match lst - (() acc) - ((head . tail) - (let* ((h (f head)) - (acc (append h acc))) - (loop tail acc)))))) - - ;;; ;;; Definition of configurations. ;;; @@ -894,13 +882,13 @@ ;; Outputs. #$@(with-heading "Outputs." - (flatmap serialize-output - (sway-configuration-outputs conf))) + (append-map serialize-output + (sway-configuration-outputs conf))) ;; Inputs. #$@(with-heading "Inputs." - (flatmap serialize-input - (sway-configuration-inputs conf))) + (append-map serialize-input + (sway-configuration-inputs conf))) ;; Bar configuration: ;; If the bar is unset, do not include anything. @@ -920,8 +908,8 @@ ;; Modes. #$@(with-heading "Modes." - (flatmap serialize-mode - (sway-configuration-modes conf))) + (append-map serialize-mode + (sway-configuration-modes conf))) ;; Startup-Programs. #$@(with-heading