Fix doc module references

This commit is contained in:
Jack Firth 2015-08-18 13:41:28 -07:00
parent 4628cf9520
commit efe8628e2c
7 changed files with 20 additions and 26 deletions

View File

@ -1,16 +1,14 @@
#lang scribble/manual
@(require lens/doc-util/main)
@(require "doc-util/main.rkt")
@title{Viewing a subset of a hash table by key}
@defmodule[unstable/lens/hash-pick]
@defproc[(hash-pick-lens [key any/c] ...) lens?]{
Creates a lens that views a subset of the target hash-table with the given
@racket[key]s. The view, is another hash-table with only the given keys and
their corrosponding values in the target hash-table.
@lenses-unstable-examples[
@lenses-examples[
(lens-view (hash-pick-lens 'a 'c) (hash 'a 1 'b 2 'c 3))
(lens-set (hash-pick-lens 'a 'c) (hash 'a 1 'b 2 'c 3) (hash 'a 4 'c 5))
]}

View File

@ -1,6 +1,6 @@
#lang scribble/manual
@(require "doc-util/main")
@(require "doc-util/main.rkt")
@title{Hash Lenses}

View File

@ -1,19 +1,17 @@
#lang scribble/manual
@(require lens/doc-util/main)
@(require "doc-util/main.rkt")
@title{Joining Lenses}
@defmodule[unstable/lens/join]
@defproc[(lens-join/list [lens lens?] ...) lens?]{
Constructs a lens that combines the view of each
@racket[lens] into a list of views. This lens can
be used to view and set a list of values in a single
target. If any of the lenses share views, then when
setting the later lenses override the earlier ones.
@lenses-unstable-examples[
@lenses-examples[
(define first-third-fifth-lens
(lens-join/list first-lens
third-lens
@ -28,7 +26,7 @@
as the hash keys. In the same manner as @racket[lens-join/list],
if lenses share views later lenses take precedence when
setting.
@lenses-unstable-examples[
@lenses-examples[
(define a-b-lens (lens-join/hash 'a first-lens
'b third-lens))
(lens-view a-b-lens '(1 2 3))
@ -37,7 +35,7 @@
@defproc[(lens-join/vector [lens lens?] ...) lens?]{
Like @racket[lens-join/list], except the view is a vector, not a list.
@lenses-unstable-examples[
@lenses-examples[
(define vector-first-third-fifth-lens
(lens-join/vector first-lens
third-lens
@ -49,7 +47,7 @@
@defproc[(lens-join/string [lens lens?] ...) lens?]{
Like @racket[lens-join/list], except the view is a string, not a list.
Each @racket[lens] argument must return a @racket[char?] as a view.
@lenses-unstable-examples[
@lenses-examples[
(define string-first-third-fifth-lens
(lens-join/string first-lens
third-lens

View File

@ -1,16 +1,14 @@
#lang scribble/manual
@(require lens/doc-util/main)
@(require "doc-util/main.rkt")
@title{List Lenses}
@defmodule[unstable/lens/list]
@title{Nested List Lenses}
@defproc[(list-ref-nested-lens [index exact-nonnegative-integer?] ...) lens?]{
Constructs a lens that views into a tree made from nested lists.
Indexing starts from zero in the same was as @racket[list-ref-lens].
@lenses-unstable-examples[
@lenses-examples[
(define first-of-second-lens (list-ref-nested-lens 1 0))
(lens-view first-of-second-lens '(1 (a b c) 2 3))
(lens-set first-of-second-lens '(1 (a b c) 2 3) 'foo)
@ -19,7 +17,7 @@
@defproc[(list-refs-lens [index exact-nonnegative-integer?] ...) lens?]{
Constructs a lens that views each @racket[index] item in a list.
Indexing starts from zero in the same was as @racket[list-ref-lens].
@lenses-unstable-examples[
@lenses-examples[
(define 1-5-6-lens (list-refs-lens 1 5 6))
(lens-view 1-5-6-lens '(a b c d e f g))
(lens-set 1-5-6-lens '(a b c d e f g) '(1 2 3))

View File

@ -1,6 +1,6 @@
#lang scribble/manual
@(require "doc-util/main")
@(require "doc-util/main.rkt")
@title{Stream Lenses}

View File

@ -1,12 +1,12 @@
#lang scribble/manual
@(require lens/doc-util/main)
@(require "doc-util/main.rkt")
@title{String Lenses}
@defproc[(string-ref-lens [i exact-nonnegative-integer?]) lens?]{
Returns a lens for viewing the @racket[i]th character of a string.
@lenses-unstable-examples[
@lenses-examples[
(lens-view (string-ref-lens 2) "abcdef")
(lens-set (string-ref-lens 2) "abcdef" #\C)
]}
@ -14,7 +14,7 @@ Returns a lens for viewing the @racket[i]th character of a string.
@defproc[(string-pick-lens [i exact-nonnegative-integer?]) lens?]{
Like @racket[list-refs-lens], but for strings.
Equivalent to @racket[(lens-join/string (string-ref-lens i) ...)].
@lenses-unstable-examples[
@lenses-examples[
(define 1-5-6-lens (string-pick-lens 1 5 6))
(lens-view 1-5-6-lens "abcdefg")
(lens-set 1-5-6-lens "abcdefg" "BFG")

View File

@ -1,12 +1,12 @@
#lang scribble/manual
@(require lens/doc-util/main)
@(require "doc-util/main.rkt")
@title{Vector lenses}
@defproc[(vector-ref-lens [i exact-nonnegative-integer?]) lens?]{
Returns a lens that views an element of a vector.
@lenses-unstable-examples[
@lenses-examples[
(lens-view (vector-ref-lens 2) #(a b c d))
(lens-set (vector-ref-lens 2) #(a b c d) "sea")
]}
@ -14,7 +14,7 @@ Returns a lens that views an element of a vector.
@defproc[(vector-ref-nested-lens [i exact-nonnegative-integer?] ...) lens?]{
Like @racket[list-ref-nested-lens], but for vectors.
Equivalent to @racket[(lens-thrush (vector-ref-lens i) ...)].
@lenses-unstable-examples[
@lenses-examples[
(lens-view (vector-ref-nested-lens 2 1) #(a b #(s i) d))
(lens-set (vector-ref-nested-lens 2 1) #(a b #(s i) d) "eye")
]}
@ -22,7 +22,7 @@ Equivalent to @racket[(lens-thrush (vector-ref-lens i) ...)].
@defproc[(vector-pick-lens [i exact-nonnegative-integer?] ...) lens?]{
Like @racket[list-refs-lens], but for vectors.
Equivalent to @racket[(lens-join/vector (vector-ref-lens i) ...)].
@lenses-unstable-examples[
@lenses-examples[
(define 1-5-6-lens (vector-pick-lens 1 5 6))
(lens-view 1-5-6-lens #(a b c d e f g))
(lens-set 1-5-6-lens #(a b c d e f g) #(1 2 3))