Next: , Previous: , Up: Exported definitions   [Contents][Index]


4.1.2 Functions

Function: == TARGET &key TEST
Package

data-lens

Source

lens.lisp (file)

Function: applicable-when FUN TEST
Package

data-lens

Source

lens.lisp (file)

Function: catting ()
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: collecting COLLECTOR
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: combine-matching-lists &key TEST &allow-other-keys
Package

data-lens

Source

lens.lisp (file)

Function: compress-runs &key COLLECTOR TEST KEY
Package

data-lens

Source

lens.lisp (file)

Function: compressing-runs &key TEST COMBINER
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: cumsum &key ADD-FUN KEY COMBINE ZERO
Package

data-lens

Source

lens.lisp (file)

Function: deduping &optional TEST
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: denest &key RESULT-TYPE
Package

data-lens

Source

lens.lisp (file)

Function: derive DIFF-FUN &key KEY
Package

data-lens

Source

lens.lisp (file)

Function: dropping N
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: element NUM
Package

data-lens

Source

lens.lisp (file)

Function: exclude PRED
Package

data-lens

Source

lens.lisp (file)

Function: exit-early ACC
Package

data-lens.transducers.internals

Source

transducer-protocol.lisp (file)

Function: filtering FUNCTION &rest ARGS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: hash-table-select HASH-TABLE
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: include PRED
Package

data-lens

Source

lens.lisp (file)

Function: iota &key START STEP COUNT
Package

data-lens.transducers

Source

lazy-sequence.lisp (file)

Function: juxt FUN1 &rest R
Package

data-lens

Source

lens.lisp (file)

Function: key KEY
Package

data-lens

Source

lens.lisp (file)

Function: key-transform FUN KEY-GET KEY-SET
Package

data-lens

Source

lens.lisp (file)

Function: lazy-sequence NEXT
Package

data-lens.transducers

Source

lazy-sequence.lisp (file)

Function: make-alist-lens KEY

A lens for updating a alist, discarding previous values

Package

data-lens.lenses

Source

optics.lisp (file)

Function: make-hash-table-lens KEY

A lens for updating a hash-table, discarding previous values

Package

data-lens.lenses

Source

optics.lisp (file)

Function: make-list-lens INDEX

A lens for updating a sequence

Package

data-lens.lenses

Source

optics.lisp (file)

Function: make-plist-lens KEY

A lens for updating a plist, preserving previous values

Package

data-lens.lenses

Source

optics.lisp (file)

Function: mapcatting FUN
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: mapping FUNCTION &rest ARGS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: maximizing RELATION MEASURE
Package

data-lens

Source

lens.lisp (file)

Function: mv-filtering FUNCTION &rest ARGS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: mv-mapping FUNCTION &rest ARGS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: mv-selecting FUNCTION &rest ARGS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: of-length LEN
Package

data-lens

Source

lens.lisp (file)

Function: of-max-length LEN
Package

data-lens

Source

lens.lisp (file)

Function: of-min-length LEN
Package

data-lens

Source

lens.lisp (file)

Function: on FUN KEY
Package

data-lens

Source

lens.lisp (file)

Function: over FUN &key RESULT-TYPE
Package

data-lens

Source

lens.lisp (file)

Function: over LENS CB REC

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.

Package

data-lens.lenses

Source

optics.lisp (file)

Function: pick SELECTOR
Package

data-lens

Source

lens.lisp (file)

Function: regex-match REGEX
Package

data-lens

Source

lens.lisp (file)

Function: repeating* V &key COUNT
Package

data-lens.transducers

Source

lazy-sequence.lisp (file)

Function: set LENS V REC

Given a lens, a value and a rec, immutably update the rec to contain the new value at the location focused by the lens.

Package

data-lens.lenses

Source

optics.lisp (file)

Function: slice START &optional END
Package

data-lens

Source

lens.lisp (file)

Function: sorted COMPARATOR &rest R &key KEY
Package

data-lens

Source

lens.lisp (file)

Function: splice-elt ELT FUN
Package

data-lens

Source

lens.lisp (file)

Function: splitting &rest FUNCTIONS
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: suffixp SUFFIX &key TEST
Package

data-lens

Source

lens.lisp (file)

Function: taking N
Package

data-lens.transducers

Source

transducers.lisp (file)

Function: transduce XF BUILD SEQ
Package

data-lens.transducers.internals

Source

transducer-protocol.lisp (file)

Function: transform-elt ELT FUN
Package

data-lens

Source

lens.lisp (file)

Function: transform-head FUN
Package

data-lens

Source

lens.lisp (file)

Function: transform-tail FUN
Package

data-lens

Source

lens.lisp (file)

Function: view LENS REC

Given a lens and a rec, return the focused value

Package

data-lens.lenses

Source

optics.lisp (file)

Function: zipping RESULT-TYPE &key FILL-VALUE
Package

data-lens

Source

lens.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]