The data-lens/beta/transducers Reference Manual
***********************************************

This is the data-lens/beta/transducers Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Jan 06 14:24:28 2021 GMT-8.

Systems
*******

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

data-lens/beta/transducers
==========================

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

License
     MIT

Description
     A collection of transducers to reduce stream-manipulation overhead

Dependencies

       * data-lens (system)

       * alexandria

Source
     data-lens.asd (file)

Components

       * package.lisp (file)

       * transducer-protocol.lisp (file)

       * transducers.lisp (file)

       * lazy-sequence.lisp (file)

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

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

License
     MIT

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

Dependencies

       * cl-ppcre

       * alexandria

       * serapeum

Source
     data-lens.asd (file)

Components

       * package.lisp (file)

       * optics.lisp (file)

       * 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/beta/transducers (system)

       * data-lens (system)

data-lens/beta/transducers/package.lisp
---------------------------------------

Parent
     data-lens/beta/transducers (system)

Location
     package.lisp

Packages

       * data-lens

       * data-lens.transducers

       * data-lens.package

       * data-lens.lenses

       * data-lens.transducers.internals

data-lens/beta/transducers/transducer-protocol.lisp
---------------------------------------------------

Dependency
     package.lisp (file)

Parent
     data-lens/beta/transducers (system)

Location
     transducer-protocol.lisp

Exported Definitions

       * exit-early (function)

       * init (generic function)

       * reduce-generic (generic function)

       * reduce-generic (method)

       * reduce-generic (method)

       * reduce-generic (method)

       * reduce-generic (method)

       * stepper (generic function)

       * transduce (function)

       * unwrap (generic function)

       * unwrap (method)

Internal Definitions
     defdocumentation (macro)

data-lens/beta/transducers/transducers.lisp
-------------------------------------------

Dependency
     transducer-protocol.lisp (file)

Parent
     data-lens/beta/transducers (system)

Location
     transducers.lisp

Exported Definitions

       * catting (function)

       * collecting (function)

       * compressing-runs (function)

       * deduping (function)

       * dropping (function)

       * filtering (function)

       * hash-table-select (function)

       * init (method)

       * init (method)

       * init (method)

       * mapcatting (function)

       * mapping (function)

       * mv-filtering (function)

       * mv-mapping (function)

       * mv-selecting (function)

       * splitting (function)

       * stepper (method)

       * stepper (method)

       * stepper (method)

       * taking (function)

       * unwrap (method)

Internal Definitions

       * comment (macro)

       * eduction (function)

       * seq (function)

       * transducer-lambda (macro)

data-lens/beta/transducers/lazy-sequence.lisp
---------------------------------------------

Dependency
     transducers.lisp (file)

Parent
     data-lens/beta/transducers (system)

Location
     lazy-sequence.lisp

Exported Definitions

       * iota (function)

       * lazy-sequence (function)

       * lazy-sequence (class)

       * reduce-generic (method)

       * repeating (macro)

       * repeating* (function)

Internal Definitions
     next (method)

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

Parent
     data-lens (system)

Location
     package.lisp

Packages

       * data-lens

       * data-lens.transducers

       * data-lens.package

       * data-lens.lenses

       * data-lens.transducers.internals

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

Dependency
     package.lisp (file)

Parent
     data-lens (system)

Location
     optics.lisp

Exported Definitions

       * make-alist-lens (function)

       * make-hash-table-lens (function)

       * make-list-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 (method)

       * unidentity (method)

       * wrap-constant (function)

       * wrap-identity (function)

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

Dependency
     optics.lisp (file)

Parent
     data-lens (system)

Location
     lens.lisp

Exported Definitions

       * <>1 (macro)

       * == (function)

       * 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)

       * functionalize (generic function)

       * functionalize (method)

       * functionalize (method)

       * functionalize (method)

       * functionalize (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)

       * suffixp (function)

       * transform-elt (function)

       * transform-head (function)

       * transform-tail (function)

       * zipping (function)

       * • (macro)

Internal Definitions

       * =>> (function)

       * cons-new (function)

       * deduplicate (function)

       * filler (function)

       * matching-list-reducer (function)

       * update (function)

       * updatef (macro)

Packages
********

Packages are listed by definition order.

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

Source
     package.lisp (file)

Use List
     common-lisp

Exported Definitions

       * <>1 (macro)

       * == (function)

       * 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)

       * functionalize (generic function)

       * functionalize (method)

       * functionalize (method)

       * functionalize (method)

       * functionalize (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)

       * suffixp (function)

       * transform-elt (function)

       * transform-head (function)

       * transform-tail (function)

       * zipping (function)

       * • (macro)

Internal Definitions

       * =>> (function)

       * cons-new (function)

       * deduplicate (function)

       * filler (function)

       * matching-list-reducer (function)

       * update (function)

       * updatef (macro)

data-lens.transducers
=====================

Source
     package.lisp (file)

Use List
     common-lisp

Exported Definitions

       * catting (function)

       * collecting (function)

       * compressing-runs (function)

       * deduping (function)

       * dropping (function)

       * filtering (function)

       * hash-table-select (function)

       * iota (function)

       * lazy-sequence (function)

       * lazy-sequence (class)

       * mapcatting (function)

       * mapping (function)

       * mv-filtering (function)

       * mv-mapping (function)

       * mv-selecting (function)

       * repeating (macro)

       * repeating* (function)

       * splitting (function)

       * taking (function)

Internal Definitions

       * comment (macro)

       * eduction (function)

       * next (generic function)

       * next (method)

       * seq (function)

       * transducer-lambda (macro)

data-lens.package
=================

Source
     package.lisp (file)

Use List
     common-lisp

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

Source
     package.lisp (file)

Use List
     common-lisp

Exported Definitions

       * make-alist-lens (function)

       * make-hash-table-lens (function)

       * make-list-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)

data-lens.transducers.internals
===============================

Source
     package.lisp (file)

Use List
     common-lisp

Exported Definitions

       * exit-early (function)

       * init (generic function)

       * init (method)

       * init (method)

       * init (method)

       * reduce-generic (generic function)

       * reduce-generic (method)

       * reduce-generic (method)

       * reduce-generic (method)

       * reduce-generic (method)

       * reduce-generic (method)

       * stepper (generic function)

       * stepper (method)

       * stepper (method)

       * stepper (method)

       * transduce (function)

       * unwrap (generic function)

       * unwrap (method)

       * unwrap (method)

Internal Definitions
     defdocumentation (macro)

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: repeating V

     Package
          data-lens.transducers

     Source
          lazy-sequence.lisp (file)

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

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Macro: • &rest FUNS

     Package
          data-lens

     Source
          lens.lisp (file)

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)

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

 -- Generic Function: functionalize IT

     Package
          data-lens

     Source
          lens.lisp (file)

     Methods
           -- Method: functionalize (IT hash-table)

           -- Method: functionalize (IT vector)

           -- Method: functionalize (IT symbol)

           -- Method: functionalize (IT function)

 -- Generic Function: init CLIENT

     Package
          data-lens.transducers.internals

     Source
          transducer-protocol.lisp (file)

     Methods
           -- Method: init (IT (eql list-builder))

               Source
                    transducers.lisp (file)

           -- Method: init (IT (eql vector-builder))

               Source
                    transducers.lisp (file)

           -- Method: init (IT (eql hash-table-builder))

               Source
                    transducers.lisp (file)

 -- Generic Function: reduce-generic SEQ FUNC INIT

     Package
          data-lens.transducers.internals

     Source
          transducer-protocol.lisp (file)

     Methods
           -- Method: reduce-generic (SEQ lazy-sequence) (FUNC function) INIT

               Source
                    lazy-sequence.lisp (file)

           -- Method: reduce-generic (SEQ sequence) (FUNC function) INIT

           -- Method: reduce-generic (SEQ sequence) (FUNC symbol) INIT

           -- Method: reduce-generic SEQ (FUNC symbol) INIT

           -- Method: reduce-generic (SEQ hash-table) (FUNC function) INIT

 -- Generic Function: stepper CLIENT

     Package
          data-lens.transducers.internals

     Source
          transducer-protocol.lisp (file)

     Methods
           -- Method: stepper (IT (eql list-builder))

               Source
                    transducers.lisp (file)

           -- Method: stepper (IT (eql vector-builder))

               Source
                    transducers.lisp (file)

           -- Method: stepper (IT (eql hash-table-builder))

               Source
                    transducers.lisp (file)

 -- Generic Function: unwrap CLIENT OBJ

     Package
          data-lens.transducers.internals

     Source
          transducer-protocol.lisp (file)

     Methods
           -- Method: unwrap (IT (eql list-builder)) OBJ

               Source
                    transducers.lisp (file)

           -- Method: unwrap CLIENT OBJ

Classes
-------

 -- Class: lazy-sequence ()

     Package
          data-lens.transducers

     Source
          lazy-sequence.lisp (file)

     Direct superclasses
          standard-object (class)

     Direct methods

            * reduce-generic (method)

            * next (method)

     Direct slots
           -- Slot: %next

               Initargs
                    :next

               Readers
                    next (generic function)

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

Macros
------

 -- Macro: comment &body BODY

     Package
          data-lens.transducers

     Source
          transducers.lisp (file)

 -- Macro: defdocumentation NAME &body DOC-SPECS

     Package
          data-lens.transducers.internals

     Source
          transducer-protocol.lisp (file)

 -- Macro: transducer-lambda &body ((TWO-ARG-ACC TWO-ARG-NEXT) &body TWO-ARG-BODY)

     Package
          data-lens.transducers

     Source
          transducers.lisp (file)

 -- 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: eduction XF SEQ

     Package
          data-lens.transducers

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

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

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: seq A B

     Package
          data-lens.transducers

     Source
          transducers.lisp (file)

 -- Function: update THING FUN &rest ARGS

     Package
          data-lens

     Source
          lens.lisp (file)

 -- Function: wrap-constant V

     Package
          data-lens.lenses

     Source
          optics.lisp (file)

 -- Function: wrap-identity V

     Package
          data-lens.lenses

     Source
          optics.lisp (file)

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

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

     Package
          data-lens.lenses

     Source
          optics.lisp (file)

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

 -- Generic Function: fmap FUNCTION DATA

     Package
          data-lens.lenses

     Source
          optics.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: next OBJECT

     Package
          data-lens.transducers

     Methods
           -- Method: next (LAZY-SEQUENCE lazy-sequence)
               automatically generated reader method

               Source
                    lazy-sequence.lisp (file)

 -- Generic Function: unconstant OBJECT

     Package
          data-lens.lenses

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

               Source
                    optics.lisp (file)

 -- Generic Function: unidentity OBJECT

     Package
          data-lens.lenses

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

               Source
                    optics.lisp (file)

Classes
-------

 -- Class: constant- ()

     Package
          data-lens.lenses

     Source
          optics.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
          optics.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
*******