diff --git a/lens.lisp b/lens.lisp index 066fd4f..5596a9b 100644 --- a/lens.lisp +++ b/lens.lisp @@ -179,6 +179,11 @@ (lambda (seq) (map 'list selector seq))) +(defun tap (cb) + (lambda (it) + (prog1 it + (funcall cb it)))) + (defun slice (start &optional end) (lambda (it) (subseq it start end))) diff --git a/package.lisp b/package.lisp index c639814..17fc338 100644 --- a/package.lisp +++ b/package.lisp @@ -21,7 +21,8 @@ #:transform-elt #:denest #:op #:defalias #:<> #:<>1 #:== #:• #:∘ #:suffixp #:functionalize #:inc #:group-by #:keys #:conj #:disj #:delay #:of-type #:transform #:calling* - #:calling)) + #:calling + #:tap)) (defpackage :data-lens.transducers.internals (:use :cl)