From 18dbfba4dc8948a9e8134705d1c8da74447ac4cc Mon Sep 17 00:00:00 2001 From: Ed Langley Date: Sun, 18 Nov 2018 14:45:15 -0800 Subject: [PATCH] Add function for following a function call with a side-effect --- lens.lisp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lens.lisp b/lens.lisp index ecff11b..9aa5d47 100644 --- a/lens.lisp +++ b/lens.lisp @@ -178,6 +178,11 @@ (apply f args)) r))))) +(defun =>> (fun1 fun2) + (lambda (i) + (prog1 (funcall fun1 i) + (funcall fun2)))) + (defun-ct derive (diff-fun &key (key #'identity)) (lambda (list) (cons (cons nil (car list))