From ea7e56385cc13c7a6f672875d8c693ee09ca1dc7 Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Sat, 15 Jul 2023 10:11:11 -0700 Subject: [PATCH] feat: add of-type to generate semipredicates --- lens.lisp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lens.lisp b/lens.lisp index d9263ae..21fca6e 100644 --- a/lens.lisp +++ b/lens.lisp @@ -193,6 +193,11 @@ (alexandria:ends-with-subseq suffix it)))) +(defun of-type (type) + (lambda (it) + (when (typep it type) + it))) + (defun transform-head (fun) (lambda (it) (typecase it