The data-lens Reference Manual
******************************

This is the data-lens Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Mon Apr 29 23:30:58 2019 GMT-8.

Systems
*******

The main system appears first, followed by any subsystem dependency.

data-lens
=========

Author
     Edward Langley <el-cl@elangley.org>

License
     MIT

Description
     Utilities for building data transormations from composable functions, modeled on lenses and transducers

Dependencies

       * cl-ppcre

       * alexandria

       * serapeum

Source
     data-lens.asd (file)

Component
     lens.lisp (file)

Files
*****

Files are sorted by type and then listed depth-first from the systems components trees.

Lisp
====

data-lens.asd
-------------

Location
     data-lens.asd

Systems
     data-lens (system)

data-lens/lens.lisp
-------------------

Parent
     data-lens (system)

Location
     lens.lisp

Packages

       * data-lens

       * data-lens.lenses

Exported Definitions

       * <>1 (macro)

       * applicable-when (function)

       * applying (macro)

       * combine-matching-lists (function)

       * compress-runs (function)

       * cumsum (function)

       * defun-ct (macro)

       * denest (function)

       * derive (function)

       * element (function)

       * exclude (function)

       * extract-key (generic function)

       * extract-key (method)

       * extract-key (method)

       * include (function)

       * juxt (function)

       * key (function)

       * key-transform (function)

       * let-fn (macro)

       * make-alist-lens (function)

       * make-hash-table-lens (function)

       * make-plist-lens (function)

       * maximizing (function)

       * of-length (function)

       * of-max-length (function)

       * of-min-length (function)

       * on (function)

       * over (function)

       * over (function)

       * pick (function)

       * regex-match (function)

       * set (function)

       * shortcut (macro)

       * slice (function)

       * sorted (function)

       * splice-elt (function)

       * transform-elt (function)

       * transform-head (function)

       * transform-tail (function)

       * view (function)

       * zipping (function)

Internal Definitions

       * =>> (function)

       * clone (generic function)

       * clone (method)

       * cons-new (function)

       * constant- (class)

       * deduplicate (function)

       * filler (function)

       * fmap (generic function)

       * fmap (method)

       * fmap (method)

       * fmap (method)

       * fmap (method)

       * identity- (class)

       * make-alist-history-lens (function)

       * matching-list-reducer (function)

       * unconstant (method)

       * unidentity (method)

       * update (function)

       * updatef (macro)

       * wrap-constant (function)

       * wrap-identity (function)

Packages
********

Packages are listed by definition order.

data-lens
=========

Source
     lens.lisp (file)

Use List
     common-lisp

Exported Definitions

       * <>1 (macro)

       * applicable-when (function)

       * applying (macro)

       * combine-matching-lists (function)

       * compress-runs (function)

       * cumsum (function)

       * defun-ct (macro)

       * denest (function)

       * derive (function)

       * element (function)

       * exclude (function)

       * extract-key (generic function)

       * extract-key (method)

       * extract-key (method)

       * include (function)

       * juxt (function)

       * key (function)

       * key-transform (function)

       * let-fn (macro)

       * maximizing (function)

       * of-length (function)

       * of-max-length (function)

       * of-min-length (function)

       * on (function)

       * over (function)

       * pick (function)

       * regex-match (function)

       * shortcut (macro)

       * slice (function)

       * sorted (function)

       * splice-elt (function)

       * transform-elt (function)

       * transform-head (function)

       * transform-tail (function)

       * zipping (function)

Internal Definitions

       * =>> (function)

       * cons-new (function)

       * deduplicate (function)

       * filler (function)

       * matching-list-reducer (function)

       * update (function)

       * updatef (macro)

data-lens.lenses
================

Source
     lens.lisp (file)

Use List
     common-lisp

Exported Definitions

       * make-alist-lens (function)

       * make-hash-table-lens (function)

       * make-plist-lens (function)

       * over (function)

       * set (function)

       * view (function)

Internal Definitions

       * clone (generic function)

       * clone (method)

       * constant- (class)

       * fmap (generic function)

       * fmap (method)

       * fmap (method)

       * fmap (method)

       * fmap (method)

       * identity- (class)

       * make-alist-history-lens (function)

       * unconstant (generic function)

       * unconstant (method)

       * unidentity (generic function)

       * unidentity (method)

       * wrap-constant (function)

       * wrap-identity (function)

Definitions
***********

Definitions are sorted by export status, category, package, and then by lexicographic order.

Exported definitions
====================

Macros
------

 -- Macro: <>1 &rest FUNS

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Macro: applying FUN &rest ARGS

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Macro: defun-ct NAME (&rest ARGS) &body BODY

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Macro: let-fn (&rest BINDINGS) &body BODY

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Macro: shortcut NAME FUNCTION &body BOUND-ARGS

     Package
          data-lens

     Source
          lens.lisp (file)

Functions
---------

 -- Function: applicable-when FUN TEST

     Package
          data-lens

     Source
          lens.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: cumsum &key ADD-FUN KEY COMBINE ZERO

     Package
          data-lens

     Source
          lens.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: element NUM

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: exclude PRED

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: include PRED

     Package
          data-lens

     Source
          lens.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: make-alist-lens KEY
     A lens for updating a alist, discarding previous values

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

 -- Function: make-hash-table-lens KEY
     A lens for updating a hash-table, discarding previous values

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

 -- Function: make-plist-lens KEY
     A lens for updating a plist, preserving previous values

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

 -- Function: maximizing RELATION MEASURE

     Package
          data-lens

     Source
          lens.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
          lens.lisp (file)

 -- Function: pick SELECTOR

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: regex-match REGEX

     Package
          data-lens

     Source
          lens.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
          lens.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: 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
          lens.lisp (file)

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

     Package
          data-lens

     Source
          lens.lisp (file)

Generic functions
-----------------

 -- Generic Function: extract-key MAP KEY

     Package
          data-lens

     Source
          lens.lisp (file)

     Methods
           -- Method: extract-key (MAP hash-table) KEY

           -- Method: extract-key (MAP list) KEY

Internal definitions
====================

Macros
------

 -- Macro: updatef PLACE FUN &rest ARGS

     Package
          data-lens

     Source
          lens.lisp (file)

Functions
---------

 -- Function: =>> FUN1 FUN2

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: cons-new &key TEST KEY

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: deduplicate &optional TEST

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: filler LENGTH1 LENGTH2 FILL-VALUE

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: make-alist-history-lens KEY
     A lens for updating a alist, preserving previous values

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

 -- Function: matching-list-reducer TEST ACC NEXT

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: update THING FUN &rest ARGS

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: wrap-constant V

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

 -- Function: wrap-identity V

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

Generic functions
-----------------

 -- Generic Function: clone OBJ &rest NEW-INITARGS &key

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

     Methods
           -- Method: clone OBJ &rest NEW-INITARGS &key around

 -- Generic Function: fmap FUNCTION DATA

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

     Methods
           -- Method: fmap FUNCTION (DATA identity-)

           -- Method: fmap FUNCTION (DATA constant-)

           -- Method: fmap FUNCTION (DATA list)

           -- Method: fmap FUNCTION (DATA vector)

 -- Generic Function: unconstant OBJECT

     Package
          data-lens.lenses

     Methods
           -- Method: unconstant (CONSTANT- constant-)
               automatically generated reader method

               Source
                    lens.lisp (file)

 -- Generic Function: unidentity OBJECT

     Package
          data-lens.lenses

     Methods
           -- Method: unidentity (IDENTITY- identity-)
               automatically generated reader method

               Source
                    lens.lisp (file)

Classes
-------

 -- Class: constant- ()

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

     Direct superclasses
          standard-object (class)

     Direct methods

            * fmap (method)

            * print-object (method)

            * unconstant (method)

     Direct slots
           -- Slot: %v

               Initargs
                    :value

               Readers
                    unconstant (generic function)

 -- Class: identity- ()

     Package
          data-lens.lenses

     Source
          lens.lisp (file)

     Direct superclasses
          standard-object (class)

     Direct methods

            * fmap (method)

            * print-object (method)

            * unidentity (method)

     Direct slots
           -- Slot: %v

               Initargs
                    :value

               Readers
                    unidentity (generic function)

Indexes
*******