The fresnel Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The fresnel Reference Manual

This is the fresnel Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Oct 13 10:55:35 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Fresnel

The Fresnel library allows bidirectional translation using lenses. Bidirectional translations allow a concrete value to be translated into an abstract value, manipulated in its abstract form, and then translated back into a concrete form without losing information. (But Fresnel is also useful for naive bidirectional translation, without retaining information.)

To be concrete, currently Fresnel is being used for program synthesis. Given the AST of a programming language we can use Fresnel to convert the AST into a DSL acceptable to a program synthesis engine, then convert the result back into the AST of a real programming language. However Fresnel could be useful for many other purposes.

A note on examples

Examples in this file are evaluated in the gt-user package from gt and use curry-compose-reader-macros. To reproduce:

(ql:quickload :gt/full)
(in-package :gt-user)
(in-readtable :curry-compose-reader-macros)

For practical purposes, you may want to use fresnel/readtable:lens-readtable instead. This also supports use quasiquotation for pattern matching (with [fare-quasiquote][]) and C-style string escapes, such as #?”\n” for a newline (with [cl-interpol][]).

Usage

Lenses are defined in the fresnel/lens package. Many functions share names with existing functions or macros (as bidirectional generalizations). It is not recommended to :USE this package. Use a package-local nickname instead:

(:local-nicknames (:l :fresnel/lens))

Writing lenses will usually involve the following steps:

  1. Define primitive translations using l:check and l:bij.
  2. Define structural translations using bidirectional pattern matching with l:match.
  3. Lift structural translations to work on containers (lists, tables) using combinators (such as l:mapcar and l:alist-mapping).
  4. Combine possible translations using l:or.

Caveats:

Lenses

Bijections

The simplest form of bidirectional translation is bijection: exhaustive, one-to-one correspondence. Bijections can be defined using l:bij.

;; A bijection between lists and vectors.
(def list-to-vector (l:bij {coerce _ 'list} {coerce _ 'vector}))

All bidirectional transformations defined by this library distinguish one domain as “concrete” and the other as “abstract.” In the above example, lists are the concrete domain and vectors are the abstract domain.

The function from concrete to abstract is invoked with l:get:

(l:get list-to-vector '(1 2 3)) => #(1 2 3)

The function from abstract to concrete is invoked with l:create:

(l:create list-to-vector #(1 2 3) => '(1 2 3))

For a bijection, the relationship between concrete and abstract can be reversed using the opp combinator:

(def vector-to-list (l:opp list-to-vector))

(l:get vector-to-list #(1 2 3)) -> '(1 2 3)
(l:create vector-to-list '(1 2 3)) -> #(1 2 3)

Basic lenses

Lenses generalize bijections by allowing the transformation in the forward direction (get) to be non-injective.

This means that, to “put back” an abstract element into the concrete domain, instead of using l:create, we use l:put with the original concrete element as a second argument.

To be a lens, a bidirectional transformation must obey three laws:

Or more informally:

Fresnel does not enforce these laws, but it does provide the function l:check-laws for testing.

The advantage of the lens laws is that they guarantee that transformations are composable. The downside is that they require all lenses to be total – but we work around the totality requirement by establishing a convention for discerning lenses.

Discerning lenses

Discerning lenses are quotient lenses that have one special equivalence class of "ill-formed values" on both sides, which can be used to do error checking while transforming in either direction.

"Ill-formed" values are defined in terms of multiple values: the first value returned from a function of a lens is considered ill-formed if the last value returned is nil.

Example: address book

Consider an address book stored as nested alists:

(def address-book
  '(("Pat"
     ("Phone" . "555-4444")
     ("URL" . "http://pat.example.com"))
    ("Chris"
     ("Phone" . "555-9999")
     ("URL" . "http://chris.example.org"))))

Assume an abstracted view of the same address book with just names and numbers:

(def abstract-original
  '(("Chris" . "555-9999")
    ("Pat" . "555-4444")))

We want to change the abstract view and have that changed reflected in the original. We drop Chris and add Jo, and change the phone number for Pat.

(def abstract2
  '(("Pat" . "555-4321")
    ("Jo" . "555-6666")))

How can we get back to a concrete address book? The solution is a lens:

(def lens
  (l:alist-mapping
   (l:match ((phone (l:identity))
             (url (l:identity) "http://google.com"))
     (list
      (cons "Phone" phone)
      (cons "URL" url))
     phone)
   :test #'equal))

This lens can reproduce the original abstract view:

(l:get lens address-book)
=> '(("Chris" . "555-9999") ("Pat" . "555-4444"))

And in the opposite direction:

(l:put lens abstract2 address-book)
=> '(("Jo"
      ("Phone" . "555-6666")
      ("URL" . "http://google.com"))
     ("Pat"
      ("Phone" . "555-4321")
      ("URL" . "http://pat.example.com")))
Walkthrough

What’s happening here? The crux is the l:match macro, which is used to translate the values of the alist. (alist-mapping is a combinator that applies a lens to all the values of a map.)

The l:match macro uses Trivia pattern matching to conveniently define bidirectional transformations. The same syntax is used to deconstruct a value that is used to construct it; we can use one form to describe how to analyze and how to build a value.

Consider a simplified concrete value:

(def c
  '(("Phone" . "555-4444")
    ("URL" . "http://pat.example.com")))

(def l
  (l:match
      ;; The components.
      ((phone (l:identity))
       (url (l:identity) "http://google.com"))
    ;; The concrete form.
    (list
     (cons "Phone" phone)
     (cons "URL" url))
    ;; The abstract form.
    phone))

What happens in the get direction?

(l:get l c)
=> "555-4444"
  1. The concrete form is matched again a Trivia pattern. If the pattern fails, the lens as a whole fails. Otherwise, Trivia binds phone and url.
  2. Each of the components is rebound to the result of calling get on the relevant lens and binding, e.g.:
    (l:get (l:identity) phone)
    
    If any component fails, the lens as a whole fails.
  3. Evaluate the abstract form. In this case, it simply returns the value of phone.

What happens in the create direction?

(l:create l "555-4444")
=> '(("Phone" . "555-4444")
     ("URL" . "http://google.com"))
  1. The abstract form is matched, binding phone.
  2. Call l:create on each component’s lens and binding:
    (l:create (l:identity) phone)
    
  3. Since url is not bound by Trivia and there is no concrete value to derive it from, the provided default is used.
  4. Evaluate the concrete form as an expression.

How is this different from what happens in the put direction, when a concrete value is provided to “fill in the blanks”?

(l:put l "555-4444" c)
=> '(("Phone" . "555-4444")
     ("URL" . "http://pat.example.com"))
  1. As before, the abstract form is matched as a Trivia pattern.
  2. Invoke the lens for each component, but using l:put instead, with the concrete value for that component.
    (l:put (l:identity) phone c)
    
  3. Match the concrete value against the concrete pattern , and use the values derived to fill in any components that are missing in the abstract value. (If the concrete value does not match, just use the defaults.)
  4. Evaluate the concrete form as an expression.

Lens combinators

Lenses can be composed with l:compose:

(l:compose (python-dsl) (python-parser))

In this case the value is parsed from a string into an AST using the lens returned by python-parser, then the AST is parsed into a DSL using the lens returned by python-dsl. (Or the other way around, of course: a DSL is unparsed into Python ASTs, and the ASTs are unparsed into a string.)

Lenses can also be combined, using l:or, in such a way that they are tried in sequence; the first sub-lens to succeed is the result of the entire lens.

Quotient lenses

Lenses were designed to address the view-update problem for sets of records (as in database records). This history shows in their assumption of an “original” that can be meaningfully used in the put direction to recover a concrete value.

In the case where a small, simple concrete AST may result in the synthesis of a large, complex abstract AST in the DSL of a synthesizer, there is usually no meaningful “original”.

Fortunately, lenses can be further generalized into quotient lenses. Quotient lenses generalize lenses so that the lens laws are respected up to some equivalence relation.

Quotient lenses are derived from lenses by quotienting – by being composed with a special type of lens, a canonizer. Lenses that have been quotiented behave the same way from the outside as basic (unquotiented) lenses and as such can be further quotiented.

The utility of quotient lenses is that they allow a style where canonization, instead of being done in one step at the edges, is interleaved as part of the overall translation.

Lenses can be quotiented on the left, concrete side (with lquot) or the right, abstract side (with rquot).

Canonizers and representativeness

Lenses translate along an axis of abstraction. A lens translates from a set of concrete elements to a set of abstract elements.

A canonizer, on the other hand, translates along an axis of representativeness. A canonizer translates from a set of elements (we will call them constituent elements) to a set of representative elements.

A canonizer, like a bijective lens, has only two functions. The two functions are called canonize and choose.

The canonize function of a canonizer takes a constituent and returns a representative for it. (It is a surjection.)

The choose function of a canonizer takes a representative and returns some constituent element. (It is an injection.)

(Why “constituent”? By analogy with representative democracy, where there is a canonizer, election, that takes a set of constituents and returns a single, canonical representative. In the case of election, the representative is also a constituent, so choose is the identity function. But it is not a requirement of canonizers that the representative belong to the set of constituents – this is the limit of the analogy.)

The axis of representativeness is orthogonal to the axis of abstraction:

When we compose a canonizer with the left (concrete) side of a lens – which is called “left quotienting” – canonize returns a more abstract representative, and choose returns a more concrete constituent. (This is a more limited form of lens composition.)

But when we compose a canonizer with the right (abstract) side of a lens – which is called “right quotienting” – then canonize returns a more concrete representative, and choose returns a more abstract constituent.

(That said, lenses and canonizers are structurally the same, and any lens can be converted into a canonizer by equating “abstract” and “representative”: get becomes canonize and create becomes choose.)

Canonizers need not be total

The formal definition of canonizers requires them to be total. We work around this by treating canonizers as discerning lenses with the behavior that, if the lens fails – if the last value returned by canonize or choose is nil – then the argument is returned unchanged.

Use left-quotienting for simplification and fix-ups

Left-quotienting coarsens the concrete domain.

For canonize, this typically means we want to ignore some aspect of the original (like whitespace).

Here is a simple canonizer that strips (usually redundant) parenthesized expression nodes from an SEL tree-sitter AST:

(defun strip-parens ()
  "Canonizer that strips parentheses."
  (l:canonizer (lambda (c)
                 (match c
                   ((parenthesized-expression-ast
                     :children `(,child))
                    child)))
               #'identity))

Except for the discerning behavior, left-quotienting behaves the same as composition. (If strip-parens were a lens, it would fail for any input that wasn’t a parenthesized expression, but as a canonizer it just returns the input unchanged.)

For choose, this typically means we want to “fix up” the concrete domain to respect some invariant (like operator precedence, or indentation, or interleaved text).

Use right-quotienting for further abstraction

Right-quotienting “coarsens the abstract domain.” This calls for illustration.

Right-quotienting for canonizing human input

One potential use for right-quotienting is handling human input. Suppose you have a lens that translates between a brittle, verbose format into a simpler one that a human can easily edit. You might want to ignore incidental aspects of the human-editable format (whitespace, indentation, case).

Right quotienting provides a principled way to do this input canonization. We define a canonizer with a canonize function that takes the messy user input and returns a cleaned-up version as its ideal representative. (Optionally, we could also define a choose function that pretty-prints that ideal representation.)

(defun input-canonizer ()
  (l:canonizer
   (lambda (c)
     (when (stringp c)
       (string-downcase
        (collapse-whitespace
         (remove #\Newline c)))))
   #'identity))

(defun my-lens* ()
  (l:rquot
   (input-canonizer)
   (my-lens)))
Right-quotienting for handling identifiers

Another potential use for right quotienting is handling identifiers. Assuming we have already performed a structural translation (e.g. into S-expressions) we might want to further translate only the identifers.

A real example: A lens implementation of FPCore translates between a generic S-expression based representation and an FPCore-specific one.

The generic S-expression representation only uses keywords. The FPCore lens, however, uses symbols interned in two specific packages: one constant package that contains only the FPCore builtins, and another “working” package that is used to intern symbols for parameters. (This distinction is important so that we can analyze FPCore expressions to find what parameters they expect.)

The goal is a trivial lens that recognizes Lisp keywords and quotients them with a canonizer.

(defun fpcore-symbol-lens ()
  "Converts between keywords and FPCore symbols."
  (l:rquot
   (fpcore-symbol-canonizer)
    (l:check #'keywordp)))

How to define the canonizer? In this case the representative value is a keyword, while the constituent value is a symbol interned in one of the FPCore packages.

We need a canonize function that gets the representative value by converting any symbol it receives into a keyword:

(lambda (c)
  (and c
       (symbolp c)
       (values (make-keyword (string c)) t)))

And we need a choose function that gets a constituent value by interning the keyword's string in the appropriate package:

(lambda (r)
  ;; Second value as intern may return a second value of nil.
  (values (intern-fpcore-symbol (string r))
          t))

These can then be combined into the canonizer we want:

(defun fpcore-symbol-canonizer ()
  "Translate between keywords and FPCore symbols, when possible."
  (l:canonizer
   (lambda (r)
     (and r
          (symbolp r)
          (values (make-keyword (string r)) t)))
   (lambda (c)
     ;; Second value as intern may return a second value of nil.
     (values (intern-fpcore-symbol (string c))
             t))))

Debugging

Since lenses are constructed, then called, they can be difficult to debug. You can use l:trace (and l:untrace) to print information about successful matches. This doesn’t help when matches are total failures, but is very helpful when the lens isn’t returning what you expect.

Copyright and Acknowledgments

Copyright (C) 2020 GrammaTech, Inc.

This code is licensed under the MIT license. See the LICENSE file in the project root for license terms.

This material is based upon work supported by the US Air Force, AFRL/RIKE and DARPA under Contract No. FA8750-20-C-0208. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the US Air Force, AFRL/RIKE or DARPA.

[fare-quasiquote]:


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 fresnel

Author

GrammaTech

License

MIT

Description

Bidirectional translation with lenses

Dependencies
Source

fresnel.asd (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.2 fresnel/fresnel

Author

GrammaTech

License

MIT

Dependencies
Source

fresnel.asd (file)

Component

file-type.lisp (file)


Previous: , Up: Systems   [Contents][Index]

2.3 fresnel/lens

Author

GrammaTech

License

MIT

Dependency

trivial-package-local-nicknames

Source

fresnel.asd (file)

Component

file-type.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 fresnel.asd

Location

fresnel.asd

Systems

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 fresnel/fresnel/file-type.lisp

Parent

fresnel/fresnel (system)

Location

fresnel.lisp

Packages

fresnel/fresnel

Exported Definitions
Internal Definitions

build-read-print-lens (function)


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 fresnel/lens/file-type.lisp

Parent

fresnel/lens (system)

Location

lens.lisp

Packages
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 fresnel/fresnel

Very high-level lenses; nothing language-specific.

Source

file-type.lisp (file)

Use List
Exported Definitions
Internal Definitions

build-read-print-lens (function)


Next: , Previous: , Up: Packages   [Contents][Index]

4.2 fresnel/lens.impl

Internal package where lenses are actually
implemented. (Working in the lens package is inconvenient as it shadows many common functions).

Source

file-type.lisp (file)

Use List
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.3 fresnel/lens

Lenses for bidirectional transformations.

As defined by Foster et al., 2007; Foster et al., 2008; Bohannon et al., 2008; and Foster et al., 2009.

It is not recommended to :USE this package; use a package-local nickname:

(:local-nicknames (:l :fresnel/lens))

The convention is for lens constructors to be functions, even if they take no arguments (such as IDENTITY). This is to be consistent with other, parametric lens constructors. For example, CAR can be called with either zero or one argument rather than having a function that takes one argument and a non-function for the zero-argument case.

The DISCERN and MATCH macros, and the CHECK, NILABLE, PATTERN, and OR functions, deal with discerning lenses. A discerning lens is a quotient lens that partitions its set of concrete structures (and similarly, its set of abstract structures) into two subsets: a set of "well-formed" values and a set of "ill-formed" values. While the set of well-formed values can be equipped with any equivalence relation as usual, all ill-formed values are considered equivalent to each other.

For each of the three functions of a discerning lens, the following must be true iff the (first) argument to the function was ill-formed:

- The first of the VALUES returned by the function is ill-formed.

- The last of the VALUES returned by the function is NIL.

By these conventions, for instance, the IDENTITY lens is discerning with NIL as its only ill-formed value, but the CAR lens is not discerning. The DISCERN macro can be wrapped around a usage of a discerning lens in order to get both the primary return value and the well-formedness together, as a single value (a cons).

Source

file-type.lisp (file)

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


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

5.1.1 Macros

Macro: discern FORM

Return a cons cell of the primary value and well-formedness from FORM.

The FORM must evaluate to the result of calling one of the functions of a discerning lens. The car of the cons cell returned by this macro is the primary value returned by FORM, and the cdr is a boolean indicating whether that value is well-formed.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: discern-values FORM

Return two values: the primary value of FORM, and its well-formedness.

FORM must evaluate to the result of calling one of the functions of a discerning lens. The first value returned by this macro is the primary value returned by FORM, and the second is a boolean indicating whether that value is well-formed.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: lazy-list &rest LENSES

Like ‘l:list’, but does not evaluate LENSES until the lens is called. Note LENSES may be evaluated more than once!

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: lazy-list* &rest LENSES

Like ‘l:list*’, but does not evaluate LENSES until the lens is called. Note LENSES may be evaluated more than once!

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: map &rest KVS

Same as ‘fset:map’.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: match BINDINGS &body PATTERNS

Return a discerning lens using BINDINGS to translate between PATTERNS.

PATTERNS is a list where every two elements, a concrete form and an abstract form, defines one lens.

Each multiple of two patterns is compiled into a separate lens, and the lens are implicitly combined with ‘l:or’.

If there is only one pattern, it is repeated. (This is an abbreviation for when the concrete and abstract forms are the same.)

If any pattern is of the form ‘($ PAT)’, then PAT is macroexpanded and the expansion is treated as the real pattern.

The BINDINGS are similar to those of a LET: each one is a list whose first element is a symbol and whose second element is a form that evaluates to a discerning lens. There may also be a third element, which is used a default in the ‘create’ direction.

The concrete form is a Trivia pattern (using the symbols from BINDINGS) that would evaluate to some concrete structure when given appropriate values for each of the symbols in BINDINGS.

Likewise the abstract form is a Trivia pattern, using the symbols from BINDINGS, that would evaluate to some abstract structure when given appropriate values.

Note that the symbols used by the concrete form/pattern and the symbols used by the abstract form/pattern do not need to be the same; the only requirement is that they both be subsets of the variables bound in BINDINGS.

If the concrete form/pattern omits variables, they are always defaulted with the provided defaults.

If the abstract pattern omits variables, the way the concrete form evaluates differs between ‘create’ and ‘put’.

If the concrete form is being evaluated in the ‘create’ direction, then missing symbols are filled in from provided defaults in the bindings of the ‘l:match’ form.

If the concrete form is being evaluated in the ‘put’ direction, then missing symbols are filled in from the provided member of the concrete domain (by matching it against the concrete pattern with ‘get’).

The GET direction first attempts to find values for the symbols in BINDINGS that would make the concrete pattern match the input. If no such values can be found, NIL is returned. Otherwise, those values are each sent through their respective lenses defined by BINDINGS, and if each of those lenses produced well-formed values, their outputs are used to construct the final output via the abstract form. The CREATE direction is analogous.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: match-list &body BINDINGS

Like ‘l:match’ for translating from list to list.
If each list has the same length, and that length is the same as the length of the bindings, there is no need to spell it out.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: match-list* &body BINDINGS

Like ‘l:match-list’, but the last binding is applied to the tail, instead of per-element.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: seq &rest ITEMS

Same as ‘fset:seq’.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: with-component-lenses (&rest BINDINGS) FN &body BODY

A helper macro for ‘l:match’.

The BINDINGS are similar to those of a LET: each one is a list whose first element is a symbol and whose second element is a form that evaluates to a discerning lens.

FN should be one of ‘l:get’, ‘l:create’, or ‘l:put’. (If you are using ‘l:put’ directly you many want to establish component-wise defaults using ‘l:with-defaults’).

Within BODY, the variables in BINDINGS are rebound to the result of calling the requested lens on the existing value of that binding, using FN.

If any lens is ill-formed (returns nil as its last value) then BODY is not evaluated and the entire form returns nil.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: with-create-lenses (&rest BINDINGS) &body BODY

Same as ‘l:with-component-lenses’ with ‘l:create’ as its function.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: with-get-lenses (&rest BINDINGS) &body BODY

Same as ‘l:with-component-lenses’ with ‘l:get’ as its function.

Package

fresnel/lens

Source

file-type.lisp (file)

Macro: with-put-lenses (&rest BINDINGS) &body BODY

Same as ‘l:with-component-lenses’ with ‘l:put’ as its function.

Package

fresnel/lens

Source

file-type.lisp (file)


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

5.1.2 Functions

Function: acond C1 A1 L1 L2

Return a lens that applies L1 or L2 depending on whether C1 or A1 hold.

The domains of L1 and L2 must be disjoint, as must be the codomains of L1 and L2. In the forward direction, applies the C1 predicate, then uses L1 if true or L2 if false. In the reverse direction, applies the A1 predicate, then uses L1 if true or L2 if false. Uses CREATE instead of PUT if C1 and A1 disagree in the reverse direction.

Same as "acond" from Foster et al., 2007.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: alist-lens ALIST &rest ARGS &key &allow-other-keys

Wrap an association list as a bijective lens.
GET on the lens becomes assoc, and CREATE on the lens becomes rassoc.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: alist-mapping L &key TEST

Lens that maps L over the values of an alist. TEST is the equality predicate on keys.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: bij GET CREATE

Return a bijective lens from the given GET function and its inverse, CREATE.

Similar to "bij" from Hoffmann et al., 2010, except that BIJ takes both directions of the bijection instead of just the forward direction.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: canonize CANONIZER VALUE

Call the canonize function from CANONIZER on VALUE.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: canonizer CANONIZE CHOOSE

Build a canonizer from two functions, CANONIZE and CHOOSE. CANONIZE and CHOOSE are treated as discerning, with special behavior: if they fail then the original values are passed through unchanged. This makes writing canonizers easier, as you don’t have to remember to explicitly pass through irrelevant values.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: car &optional D

Return a lens to extract the car of a cons cell.

If D is given, uses it as a default cdr value for CREATE.

Similar to "hd" from Foster et al., 2007, except that CAR makes D optional and simply omits the "create" function if D is not provided.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: cdr &optional D

Return a lens to extract the cdr of a cons cell.

If D is given, uses it as a default car value for CREATE.

Similar to "tl" from Foster et al., 2007, except that CDR makes D optional and simply omits the "create" function if D is not provided.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: check PRED

Return a discerning identity lens whose well-formed values all satisfy PRED.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: check-laws LENS C A &key TEST

Check that LENS obeys the lens laws for C, a concrete value, and A, an abstract value, using TEST as the equivalence relation.

Returns four boolean values:
1. Whether all the laws were respected.
2. Whether GetPut was respected.
3. Whether PutGet was respected.
4. Whether CreateGet was respected.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: check-subtype TYPE

Return a discering identity lens whose well-formed values are subtypes of TYPE.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: check-type TYPE

Return a discering identity lens whose well-formed values are of TYPE.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: choose CANONIZER VALUE

Call the choose function from CANONIZER on VALUE.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: combine COMBINER LENS

Convert a bijection into a lens.

Return a lens that, in the PUT direction, uses COMBINER, a function, to augment the value constructed by LENS with the old value.

Converts a bijection into a lens by using COMBINER to "patch" the result of ‘create’ with the old concrete value.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: compose &rest LENSES

Return a lens that abstracts through the LENSES in order.

Similar to the semicolon combinator from Foster et al., 2007, except that COMPOSE acts like ALEXANDRIA:COMPOSE in that (in the forward direction) lenses are applied from back to front rather than from front to back. That is, l;k is the same as (compose k l).

Allows the composition of zero lenses, equivalent to the identity
lens.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: compose* &rest LENSES

Like ‘l:compose’, but discerning.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: cons L1 L2

Return a lens that applies L1 to the car, and L2 to cdr, of a cons cell.

Inspired by "xfork" from Foster et al., 2007.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: constantly V &optional D

Return a lens that always returns V.

If D is given, uses it as a default value for CREATE.

Similar to "const" from Foster et al., 2007, except that CONSTANTLY makes D optional and simply omits the "create" function if D is not provided.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: create L A

Return a concrete value from the abstract view A through the lens L.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: default X

As a function, identity.

As a Trivia pattern, matches anything.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: fset-mapping L

Lens that maps L over the values of an FSet map.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: gensym-lens ()

Lens to convert between a concrete string to an abstract gensym.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: gensym? X

Is X a symbol without a package?

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: get L C

Return an abstract view of C through the lens L.

Not analogous to CL:GET.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: guard PRED LENS

Return a discerning lens whose well-formed concrete values all satisfy PRED.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: hash-table-alist &key TEST

Lens that translates between hash tables and alists.
In the PUT direction, the hash table test is taken from the old hash table; otherwise TEST is used.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: hash-table-mapping L

Lens that maps L over the values of a hash table. See ‘l:mapping’ for the details.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: identity ()

Return the identity lens.

Same as "id" from Foster et al., 2007.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: identity! ()

Like l:identity, but returns T as its second value. This allows it to work even on null values.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: keyword-lens ()

Lens to convert between a concrete string and an abstract keyword.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: lazy F

Return a lens that acts like the lens returned by F.

Doesn’t call F until necessary, but also doesn’t cache the result of F. To get caching, compose this function with something like SERAPEUM:ONCE.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: lens GET PUT &optional CREATE

Create a lens from GET, PUT, and CREATE functions.
If CREATE is not provided, it is treated as PUT with a concrete argument of nil.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: list &rest LENSES

Return a lens that matches a sequence of lenses.
That is, it matches values that are sequences of the same length as LENSES, if every lens in LENSES matches the element at the same position in the value.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: list* &rest LENSES

Like ‘l:list’, but the last lens matches a tail of unspecified length.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: lquot CANONIZER LENS

Coarsen the (concrete) domain of QLENS using CANONIZER.
Return a new q-lens.

Composes the get function of QLENS with the canonizer of Q and composes the chooser of Q with the put/create function of QLENS.

When using ‘lquot’, only concrete values are changed. The canonizer is called directly on the concrete arguments to GET and PUT, while the chooser is called on the concrete result of CREATE and PUT (if they succeed).

Package

fresnel/lens

Source

file-type.lisp (file)

Function: lquot* &rest LENSES

Reduce lenses with ‘l:lquot’, from the end.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: mapcar L

Return a lens that applies L to every element of a list.

Similar to "list_map" from Foster et al., 2007.

This is a discerning lens: L is assumed to be discerning, and if it fails for any element, then the entire lens fails.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: mapping LENS &key MAKER GETTER SETTER WALKER

Low-level lens that maps LENS over some kind of key-value mapping (table).

If you are writing lenses for translation, you probably want to use ‘alist-mapping’, ‘hash-table-mapping’, or ‘fset-mapping’. This function is lower-level, for supporting new tabular data structures in a consistent way.

In the GET direction, the new lens returns an abstract table where the keys are the same as the concrete table, but the values are the result of passing each value through LENS.

In the CREATE direction, the new lens returns a concrete table with the same keys (domain) as the abstract table, and values derived by passing the values through LENS.

In the PUT direction, the new lens also returns a concrete table with the same keys as the abstract table, but the values depend on which keys are also present in the concrete table. If the same key is present in both tables, then the new concrete value is computed using PUT with the abstract value and the old concrete value; otherwise CREATE is used.

Note that it is always the case (by design) that keys that are present in the concrete table but not the abstract table are lost.

Takes four callbacks:

1. MAKER is a function of one argument that creates a new, empty mapping that is "like" its argument (e.g. a hash table having
the same test.)

2. GETTER takes a table and a key and returns two values (like ‘gethash’, but the table comes before the key).

3. SETTER takes a table, a key, and a value, and returns a table updated with the new key and value. It is fine if the table is mutated, but the return value has to be the table.

4. WALKER takes a table and a binary function and maps it over the entries in the table (like ‘maphash’).

Package

fresnel/lens

Source

file-type.lisp (file)

Function: nilable L

Return a discerning lens that acts like L but has no ill-formed values.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: opp L

Return a bijective lens that acts like L in reverse.

Completely discards all PUT behavior of L, making use only of GET and CREATE.

Similar to "op" from Hoffmann et al., 2010, except that OPP is not involutory because the lenses defined in this package are not symmetric.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: or &rest LENSES

Return a lens that tries LENSES in order until one succeeds. A lens succeeds if the last value it returns is not ‘nil’.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: or! &rest LENSES

Like ‘l:or’, but strict.
If more than one lens in LENSES matches, that’s an error.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: path PATH

Return a lens to access the subtree of an FSet structure at PATH.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: print-read-lens TYPE &rest ARGS &key

Like ‘read-print-lens’, but translates between concrete values and abstract strings.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: put L A C

Return an updated version of C using the abstract view A through the lens L.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: qlens GET PUT CREATE
Package

fresnel/lens

Source

file-type.lisp (file)

Function: rguard PRED LENS

Return a discerning lens whose well-formed abstract values all satisfy PRED.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: rquot CANONIZER LENS

Coarsen the (abstract) codomain of QLENS using CANONIZER.
Return a new q-lens.

Composes the choose function of CANONIZER with the get function of QLENS, and composes the put/create function of QLENS with the canonizer function of CANONIZER.

When using ‘rquot’, only abstract values are changed. The canonizer is called directly on the abstract arguments to PUT and CREATE, while the chooser is called on the abstract result of GET (if it succeeds).

Package

fresnel/lens

Source

file-type.lisp (file)

Function: rquot* &rest LENSES

Reduce lenses with ‘l:rquot’, from the end.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: trace ()

Trace (successful) lens matching.

Package

fresnel/lens

Source

file-type.lisp (file)

Function: untrace ()

Stop tracing lens matching.

Package

fresnel/lens

Source

file-type.lisp (file)


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

5.1.3 Generic functions

Generic Function: read-print-lens TYPE &key FORMAT PACKAGE

Construct a lens to translate between concrete
strings and abstract values of type TYPE, using the appropriate Lisp reader/parser and printer.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Methods
Method: read-print-lens (TYPE (eql integer)) &key
Method: read-print-lens (TYPE (eql number)) &key
Method: read-print-lens (TYPE (eql float)) &key FORMAT
Method: read-print-lens (TYPE (eql double-float)) &key
Method: read-print-lens (TYPE (eql single-float)) &key
Method: read-print-lens (TYPE (eql symbol)) &key PACKAGE

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

5.1.4 Classes

Class: bij ()

Every bijection is also a lens, using a put function that ignores its second arg.

Package

fresnel/lens

Source

file-type.lisp (file)

Direct superclasses

lens (class)

Direct subclasses

canonizer (class)

Direct methods

print-object (method)

Class: canonizer ()

A canonizer is a kind of bijection.
A lens is "quotiented" with a canonizer, resulting in a quotient lens.

The canonize function of the canonizer is called on arguments to the lens; the choose function of the canonizer is called on the values the lens returns.

Package

fresnel/lens

Source

file-type.lisp (file)

Direct superclasses

bij (class)

Direct methods
Direct slots
Slot: get

Function that maps an element to its canonical representative.

Initargs

:canonize

Readers

canonize-fn (generic function)

Slot: create

Function that maps a canonical representive to some element.

Initargs

:choose

Readers

choose-fn (generic function)

Class: lens ()

A basic lens.

Lenses are a kind of bidirectional transformation.

Lenses generalize bijections by allowing the transformation in the forward direction (get) to be non-injective. (Put is still injective, however.)

Lenses must satisfy the following laws:

- GetPut: (put l (get l c) c) = c for all c from C
- PutGet: (get l (put l a c)) = a for all (a, c) from A × C
- CreateGet: (get l (create l a)) = a for all a from A

Of course, the CreateGet law need not hold for a lens that does not have a CREATE function.

Package

fresnel/lens

Source

file-type.lisp (file)

Direct superclasses

qlens (class)

Direct subclasses

bij (class)

Direct methods
  • convert (method)
  • print-object (method)
Class: qlens ()

Quotient lenses generalize lenses so that the lens laws are respected up to some equivalence relation.

Lenses may be "quotiented" arbitrarily with canonizers (a kind of bijective lens) on the left (concrete) or right (abstract) side. This allows a style where canonicalization is pervasive and interleaved rather than being done in one step at the edges.

Practically they treat certain data as ignorable.

Package

fresnel/lens

Source

file-type.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

lens (class)

Direct methods
Direct slots
Slot: get

A function from C to A.

Type

(function (*) *)

Readers

get-fn (generic function)

Slot: put

A function from A × C to C.

Type

(function (* *) *)

Readers

put-fn (generic function)

Slot: create

A function from A to C.

Need not be defined on every lens; if it is unbound, then the CREATE function simply throws an error.

Type

(function (*) *)

Readers

create-fn (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


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

5.2.1 Constants

Constant: +storage-for-deflex-var-+unbound++

Distinguished value that makes a binding morally unbound.

Package

fresnel/lens.impl

Source

file-type.lisp (file)


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

5.2.2 Special variables

Special Variable: *depth*

Depth of lens matching.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Special Variable: *trace*

Are we tracing?

Package

fresnel/lens.impl

Source

file-type.lisp (file)


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

5.2.3 Symbol macros

Symbol Macro: %concrete-defaults
Package

fresnel/lens.impl

Source

file-type.lisp (file)

Expansion

fresnel/lens.impl::*storage-for-deflex-var-%concrete-defaults*

Symbol Macro: +identity-lens+
Package

fresnel/lens.impl

Source

file-type.lisp (file)

Expansion

fresnel/lens.impl::*storage-for-deflex-var-+identity-lens+*

Symbol Macro: +unbound+
Package

fresnel/lens.impl

Source

file-type.lisp (file)

Expansion

fresnel/lens.impl::+storage-for-deflex-var-+unbound++


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

5.2.4 Macros

Macro: match-aux BINDINGS &body C-FORM

Actually construct a lens from a pair of concrete and abstract forms.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Macro: with-morally-unbound-variables (&rest VARS) &body BODY

Bind VARS around BODY in such a way that they are morally unbound.

Package

fresnel/lens.impl

Source

file-type.lisp (file)


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

5.2.5 Functions

Function: build-read-print-lens TYPE PARSER UNPARSER

Construct a bijection between a concrete string and an abstract value of TYPE using a function PARSER and a function UNPARSER.

The lens only matches if the value returned by PARSER is of TYPE. Errors of type ‘parse-error’ from PARSER are also considered failures.

Package

fresnel/fresnel

Source

file-type.lisp (file)

Function: discern-values* FN

Helper function for ‘discern-values’.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Function: extract-defaults BINDINGS
Package

fresnel/lens.impl

Source

file-type.lisp (file)

Function: lookup-default COL KEY DEFAULT

Like ‘fset:lookup’, but return DEFAULT if KEY was not present. The second value is T if the key was present, NIL otherwise.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Function: maybe-trace DIRECTION NAMES LENS-FORMS &rest RESULTS

If tracing, print the results of successful lens matching.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Function: morally-unbound? SYM ENV

Return non-nil if SYM is (morally) unbound in ENV.

Package

fresnel/lens.impl

Source

file-type.lisp (file)

Function: split-bindings BINDINGS

Split a two-element list into a list of the first elements and a list of the second elements.

Package

fresnel/lens.impl

Source

file-type.lisp (file)


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

5.2.6 Generic functions

Generic Function: canonize-fn OBJECT
Package

fresnel/lens.impl

Methods
Method: canonize-fn (CANONIZER canonizer)

Function that maps an element to its canonical representative.

Source

file-type.lisp (file)

Generic Function: choose-fn OBJECT
Package

fresnel/lens.impl

Methods
Method: choose-fn (CANONIZER canonizer)

Function that maps a canonical representive to some element.

Source

file-type.lisp (file)

Generic Function: create-fn OBJECT
Package

fresnel/lens.impl

Methods
Method: create-fn (QLENS qlens)

A function from A to C.

Need not be defined on every lens; if it is unbound, then the CREATE function simply throws an error.

Source

file-type.lisp (file)

Generic Function: get-fn OBJECT
Package

fresnel/lens.impl

Methods
Method: get-fn (QLENS qlens)

A function from C to A.

Source

file-type.lisp (file)

Generic Function: put-fn OBJECT
Package

fresnel/lens.impl

Methods
Method: put-fn (QLENS qlens)

A function from A × C to C.

Source

file-type.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.7 Conditions

Condition: lens-error ()
Package

fresnel/lens.impl

Source

file-type.lisp (file)

Direct superclasses

simple-error (condition)

Direct methods

lens-error-lens (method)

Direct slots
Slot: lens
Initargs

:lens

Readers

lens-error-lens (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, fresnel.asd: The fresnel․asd file
File, Lisp, fresnel/fresnel/file-type.lisp: The fresnel/fresnel/file-type․lisp file
File, Lisp, fresnel/lens/file-type.lisp: The fresnel/lens/file-type․lisp file
fresnel.asd: The fresnel․asd file
fresnel/fresnel/file-type.lisp: The fresnel/fresnel/file-type․lisp file
fresnel/lens/file-type.lisp: The fresnel/lens/file-type․lisp file

L
Lisp File, fresnel.asd: The fresnel․asd file
Lisp File, fresnel/fresnel/file-type.lisp: The fresnel/fresnel/file-type․lisp file
Lisp File, fresnel/lens/file-type.lisp: The fresnel/lens/file-type․lisp file

Jump to:   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   U   W  
Index Entry  Section

A
acond: Exported functions
alist-lens: Exported functions
alist-mapping: Exported functions

B
bij: Exported functions
build-read-print-lens: Internal functions

C
canonize: Exported functions
canonize-fn: Internal generic functions
canonize-fn: Internal generic functions
canonizer: Exported functions
car: Exported functions
cdr: Exported functions
check: Exported functions
check-laws: Exported functions
check-subtype: Exported functions
check-type: Exported functions
choose: Exported functions
choose-fn: Internal generic functions
choose-fn: Internal generic functions
combine: Exported functions
compose: Exported functions
compose*: Exported functions
cons: Exported functions
constantly: Exported functions
create: Exported functions
create-fn: Internal generic functions
create-fn: Internal generic functions

D
default: Exported functions
discern: Exported macros
discern-values: Exported macros
discern-values*: Internal functions

E
extract-defaults: Internal functions

F
fset-mapping: Exported functions
Function, acond: Exported functions
Function, alist-lens: Exported functions
Function, alist-mapping: Exported functions
Function, bij: Exported functions
Function, build-read-print-lens: Internal functions
Function, canonize: Exported functions
Function, canonizer: Exported functions
Function, car: Exported functions
Function, cdr: Exported functions
Function, check: Exported functions
Function, check-laws: Exported functions
Function, check-subtype: Exported functions
Function, check-type: Exported functions
Function, choose: Exported functions
Function, combine: Exported functions
Function, compose: Exported functions
Function, compose*: Exported functions
Function, cons: Exported functions
Function, constantly: Exported functions
Function, create: Exported functions
Function, default: Exported functions
Function, discern-values*: Internal functions
Function, extract-defaults: Internal functions
Function, fset-mapping: Exported functions
Function, gensym-lens: Exported functions
Function, gensym?: Exported functions
Function, get: Exported functions
Function, guard: Exported functions
Function, hash-table-alist: Exported functions
Function, hash-table-mapping: Exported functions
Function, identity: Exported functions
Function, identity!: Exported functions
Function, keyword-lens: Exported functions
Function, lazy: Exported functions
Function, lens: Exported functions
Function, list: Exported functions
Function, list*: Exported functions
Function, lookup-default: Internal functions
Function, lquot: Exported functions
Function, lquot*: Exported functions
Function, mapcar: Exported functions
Function, mapping: Exported functions
Function, maybe-trace: Internal functions
Function, morally-unbound?: Internal functions
Function, nilable: Exported functions
Function, opp: Exported functions
Function, or: Exported functions
Function, or!: Exported functions
Function, path: Exported functions
Function, print-read-lens: Exported functions
Function, put: Exported functions
Function, qlens: Exported functions
Function, rguard: Exported functions
Function, rquot: Exported functions
Function, rquot*: Exported functions
Function, split-bindings: Internal functions
Function, trace: Exported functions
Function, untrace: Exported functions

G
Generic Function, canonize-fn: Internal generic functions
Generic Function, choose-fn: Internal generic functions
Generic Function, create-fn: Internal generic functions
Generic Function, get-fn: Internal generic functions
Generic Function, put-fn: Internal generic functions
Generic Function, read-print-lens: Exported generic functions
gensym-lens: Exported functions
gensym?: Exported functions
get: Exported functions
get-fn: Internal generic functions
get-fn: Internal generic functions
guard: Exported functions

H
hash-table-alist: Exported functions
hash-table-mapping: Exported functions

I
identity: Exported functions
identity!: Exported functions

K
keyword-lens: Exported functions

L
lazy: Exported functions
lazy-list: Exported macros
lazy-list*: Exported macros
lens: Exported functions
list: Exported functions
list*: Exported functions
lookup-default: Internal functions
lquot: Exported functions
lquot*: Exported functions

M
Macro, discern: Exported macros
Macro, discern-values: Exported macros
Macro, lazy-list: Exported macros
Macro, lazy-list*: Exported macros
Macro, map: Exported macros
Macro, match: Exported macros
Macro, match-aux: Internal macros
Macro, match-list: Exported macros
Macro, match-list*: Exported macros
Macro, seq: Exported macros
Macro, with-component-lenses: Exported macros
Macro, with-create-lenses: Exported macros
Macro, with-get-lenses: Exported macros
Macro, with-morally-unbound-variables: Internal macros
Macro, with-put-lenses: Exported macros
map: Exported macros
mapcar: Exported functions
mapping: Exported functions
match: Exported macros
match-aux: Internal macros
match-list: Exported macros
match-list*: Exported macros
maybe-trace: Internal functions
Method, canonize-fn: Internal generic functions
Method, choose-fn: Internal generic functions
Method, create-fn: Internal generic functions
Method, get-fn: Internal generic functions
Method, put-fn: Internal generic functions
Method, read-print-lens: Exported generic functions
Method, read-print-lens: Exported generic functions
Method, read-print-lens: Exported generic functions
Method, read-print-lens: Exported generic functions
Method, read-print-lens: Exported generic functions
Method, read-print-lens: Exported generic functions
morally-unbound?: Internal functions

N
nilable: Exported functions

O
opp: Exported functions
or: Exported functions
or!: Exported functions

P
path: Exported functions
print-read-lens: Exported functions
put: Exported functions
put-fn: Internal generic functions
put-fn: Internal generic functions

Q
qlens: Exported functions

R
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
read-print-lens: Exported generic functions
rguard: Exported functions
rquot: Exported functions
rquot*: Exported functions

S
seq: Exported macros
split-bindings: Internal functions

T
trace: Exported functions

U
untrace: Exported functions

W
with-component-lenses: Exported macros
with-create-lenses: Exported macros
with-get-lenses: Exported macros
with-morally-unbound-variables: Internal macros
with-put-lenses: Exported macros

Jump to:   A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   %   *   +  
C   G   L   P   S  
Index Entry  Section

%
%concrete-defaults: Internal symbol macros

*
*depth*: Internal special variables
*trace*: Internal special variables

+
+identity-lens+: Internal symbol macros
+storage-for-deflex-var-+unbound++: Internal constants
+unbound+: Internal symbol macros

C
Constant, +storage-for-deflex-var-+unbound++: Internal constants
create: Exported classes
create: Exported classes

G
get: Exported classes
get: Exported classes

L
lens: Internal conditions

P
put: Exported classes

S
Slot, create: Exported classes
Slot, create: Exported classes
Slot, get: Exported classes
Slot, get: Exported classes
Slot, lens: Internal conditions
Slot, put: Exported classes
Special Variable, *depth*: Internal special variables
Special Variable, *trace*: Internal special variables
Symbol Macro, %concrete-defaults: Internal symbol macros
Symbol Macro, +identity-lens+: Internal symbol macros
Symbol Macro, +unbound+: Internal symbol macros

Jump to:   %   *   +  
C   G   L   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   F   L   P   Q   S  
Index Entry  Section

B
bij: Exported classes

C
canonizer: Exported classes
Class, bij: Exported classes
Class, canonizer: Exported classes
Class, lens: Exported classes
Class, qlens: Exported classes
Condition, lens-error: Internal conditions

F
fresnel: The fresnel system
fresnel/fresnel: The fresnel/fresnel system
fresnel/fresnel: The fresnel/fresnel package
fresnel/lens: The fresnel/lens system
fresnel/lens: The fresnel/lens package
fresnel/lens.impl: The fresnel/lens․impl package

L
lens: Exported classes
lens-error: Internal conditions

P
Package, fresnel/fresnel: The fresnel/fresnel package
Package, fresnel/lens: The fresnel/lens package
Package, fresnel/lens.impl: The fresnel/lens․impl package

Q
qlens: Exported classes

S
System, fresnel: The fresnel system
System, fresnel/fresnel: The fresnel/fresnel system
System, fresnel/lens: The fresnel/lens system

Jump to:   B   C   F   L   P   Q   S