From a59bfd4f9a8cae335025aa8acd509d41fe9a398b Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 20 Apr 2026 00:23:21 +0100 Subject: Add add lens. --- kaagum/lens.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kaagum/lens.scm b/kaagum/lens.scm index 6739244..bbd11f5 100644 --- a/kaagum/lens.scm +++ b/kaagum/lens.scm @@ -24,6 +24,7 @@ #:export (vector-nth in-json push + add prepend-over alist-delete-over)) @@ -51,6 +52,10 @@ possible to traverse JSON trees." on." (over lens (cut cons x <>) object)) +(define (add lens x object) + "Add @var{x} onto the part of @var{object} that @var{lens} focuses on." + (over lens (cut + x <>) object)) + (define (prepend-over lens lst object) "Prepend @var{lst} to the part of @var{object} that @var{lens} focuses on." -- cgit 1.4.1