This is the data-lens Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:57:28 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
data-lens
Utilities for building data transformations from composable functions, modeled on lenses and transducers
Edward Langley <el-cl@elangley.org>
Apache v2
cl-ppcre
(system).
alexandria
(system).
package.lisp
(file).
optics.lisp
(file).
lens.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
data-lens/optics.lisp
package.lisp
(file).
data-lens
(system).
make-alist-lens
(function).
make-hash-table-lens
(function).
make-list-lens
(function).
make-plist-lens
(function).
over
(function).
print-object
(method).
print-object
(method).
set
(function).
view
(function).
clone
(generic function).
constant-
(class).
fmap
(generic function).
identity-
(class).
make-alist-history-lens
(function).
unconstant
(reader method).
unidentity
(reader method).
wrap-constant
(function).
wrap-identity
(function).
data-lens/lens.lisp
optics.lisp
(file).
data-lens
(system).
<>1
(macro).
==
(function).
applicable-when
(function).
applying
(macro).
calling
(macro).
calling*
(macro).
combine-matching-lists
(function).
compress-runs
(function).
conj
(macro).
cumsum
(function).
defun-ct
(macro).
delay
(function).
denest
(function).
derive
(function).
disj
(macro).
element
(function).
exclude
(function).
extract-key
(generic function).
functionalize
(compiler macro).
functionalize
(generic function).
group-by
(function).
inc
(function).
include
(function).
juxt
(function).
key
(function).
key-transform
(function).
keys
(function).
let-fn
(macro).
maximizing
(function).
of-length
(function).
of-max-length
(function).
of-min-length
(function).
of-type
(function).
on
(function).
over
(function).
pick
(function).
regex-match
(function).
shortcut
(macro).
slice
(function).
sorted
(function).
splice-elt
(function).
suffixp
(function).
transform
(function).
transform-elt
(function).
transform-head
(function).
transform-tail
(function).
zipping
(function).
•
(macro).
∘
(macro).
=>>
(function).
cons-new
(function).
deduplicate
(function).
filler
(function).
matching-list-reducer
(function).
update
(function).
updatef
(macro).
Packages are listed by definition order.
data-lens
common-lisp
.
<>1
(macro).
==
(function).
applicable-when
(function).
applying
(macro).
calling
(macro).
calling*
(macro).
combine-matching-lists
(function).
compress-runs
(function).
conj
(macro).
cumsum
(function).
defun-ct
(macro).
delay
(function).
denest
(function).
derive
(function).
disj
(macro).
element
(function).
exclude
(function).
extract-key
(generic function).
functionalize
(compiler macro).
functionalize
(generic function).
group-by
(function).
inc
(function).
include
(function).
juxt
(function).
key
(function).
key-transform
(function).
keys
(function).
let-fn
(macro).
maximizing
(function).
of-length
(function).
of-max-length
(function).
of-min-length
(function).
of-type
(function).
on
(function).
over
(function).
pick
(function).
regex-match
(function).
shortcut
(macro).
slice
(function).
sorted
(function).
splice-elt
(function).
suffixp
(function).
transform
(function).
transform-elt
(function).
transform-head
(function).
transform-tail
(function).
zipping
(function).
•
(macro).
∘
(macro).
=>>
(function).
cons-new
(function).
deduplicate
(function).
filler
(function).
matching-list-reducer
(function).
update
(function).
updatef
(macro).
data-lens.lenses
common-lisp
.
make-alist-lens
(function).
make-hash-table-lens
(function).
make-list-lens
(function).
make-plist-lens
(function).
over
(function).
set
(function).
view
(function).
clone
(generic function).
constant-
(class).
fmap
(generic function).
identity-
(class).
make-alist-history-lens
(function).
unconstant
(generic reader).
unidentity
(generic reader).
wrap-constant
(function).
wrap-identity
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Return a function that always returns the last thing it was called with
A lens for updating a alist, discarding previous values
A lens for updating a hash-table, discarding previous values
A lens for updating a sequence
A lens for updating a plist, preserving previous values
Transform arguments with KEY and then apply FUN
> (eql (funcall (on ’equal ’car)
> ’("a" 1 2)
> ’("a" 2 e))
> t)
Given a lens, a callback and a record, apply the lens to the record, transform it by the callback and return copy of the record, updated to contain the result of the callback. This is the fundamental operation on a lens and SET and VIEW are implemented in terms of it.
A lens is any function of the form (lambda (fun) (lambda (rec) ...))
that obeys the lens laws (where == is some reasonable equality
operator):
(== (view lens (set lens value rec))
value)
(== (set lens (view lens rec) rec)
rec)
(== (set lens value2 (set lens value1 rec))
(set lens value2 rec))
The inner lambda returns a functor that determines the policy to be
applied to the focused part. By default, this only uses IDENTITY- and
CONSTANT- in order to implement the lens operations over, set and
view.
If these conditions are met, (over (data-lens:<>1 lens1 lens2) ...) is equivalent to using lens2 to focus the part lens1 focuses: note that composition is "backwards" from what one might expect: this is because composition composes the wrapper lambdas and applies the lambda that actually pulls a value out of a record later.
Given a lens, a value and a rec, immutably update the rec to contain the new value at the location focused by the lens.
Given a lens and a rec, return the focused value
A lens for updating a alist, preserving previous values
Jump to: | <
=
•
∘
A C D E F G I J K L M O P R S T U V W Z |
---|
Jump to: | <
=
•
∘
A C D E F G I J K L M O P R S T U V W Z |
---|
Jump to: | %
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
% | |||
%v : | Private classes | ||
%v : | Private classes | ||
| |||
S | |||
Slot, %v : | Private classes | ||
Slot, %v : | Private classes | ||
|
Jump to: | %
S |
---|
Jump to: | C D F I L O P S |
---|
Jump to: | C D F I L O P S |
---|