fix doc stuff

This commit is contained in:
AlexKnauth 2015-07-18 00:13:36 -04:00
parent 0bffdc3e6d
commit 654c0c7ece
6 changed files with 15 additions and 17 deletions

View File

@ -18,10 +18,10 @@
(define-examples-form lenses-examples
lens racket/list)
lens racket/list racket/stream)
(define-examples-form lenses-applicable-examples
lens/applicable racket/list)
lens/applicable racket/list racket/stream)
(define-examples-form lenses-unstable-examples
lens unstable/lens racket/list)
lens unstable/lens racket/list racket/stream)

View File

@ -7,6 +7,7 @@
unstable/lens
racket/base
racket/list
racket/stream
racket/contract
)
(for-syntax racket/base
@ -24,6 +25,7 @@
unstable/lens
racket/base
racket/list
racket/stream
racket/contract
))
(for-syntax (all-from-out

View File

@ -16,7 +16,7 @@ switched, so that the @racket[target] comes first and the
@racket[(lens-view (lens-thrush lens ...) target)], but can be more
efficient.
The function @racket[lens-view~>] is provided as a shorter version.
@lenses-examples[
@lenses-unstable-examples[
(lens-view/thrush '(a b ((c d) e f) g) third-lens first-lens second-lens)
(lens-view~> '(a b ((c d) e f) g) third-lens first-lens second-lens)
]}
@ -28,7 +28,7 @@ which again are combined into a nested lens.
@racket[(lens-set/thrush target lens ... #:-> new-view)] is equivalent
to @racket[(lens-set (lens-thrush lens ...) target new-view)], and
@racket[lens-set~>] is the shorter version.
@lenses-examples[
@lenses-unstable-examples[
(lens-set/thrush '(a b ((c d) e f) g) third-lens first-lens second-lens #:-> "sea")
(lens-set~> '(a b ((c d) e f) g) third-lens first-lens second-lens #:-> "sea")
]}
@ -45,7 +45,7 @@ just like @racket[lens-set/thrush].
equivalent to
@racket[(lens-transform (lens-thrush lens ...) target transformer)],
and @racket[lens-transform~>] is the shorter verison.
@lenses-examples[
@lenses-unstable-examples[
(lens-transform/thrush '(a b ((c d) e f) g) third-lens first-lens second-lens #:-> symbol->string)
(lens-transform~> '(a b ((c d) e f) g) third-lens first-lens second-lens #:-> symbol->string)
]}

View File

@ -11,6 +11,6 @@ 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[
(lens-view (hash-slice-lens 'a 'c) (hash 'a 1 'b 2 'c 3))
(lens-set (hash-slice-lens 'a 'c) (hash 'a 1 'b 2 'c 3) (hash 'a 4 'c 5))
(lens-view (hash-pluck-lens 'a 'c) (hash 'a 1 'b 2 'c 3))
(lens-set (hash-pluck-lens 'a 'c) (hash 'a 1 'b 2 'c 3) (hash 'a 4 'c 5))
]}

View File

@ -16,8 +16,6 @@ Like @racket[list-refs-lens], but for strings.
Equivalent to @racket[(lens-join/string (string-ref-lens i) ...)].
@lenses-unstable-examples[
(define 1-5-6-lens (string-pluck-lens 1 5 6))
(check-equal? (lens-view 1-5-6-lens "abcdefg")
"bfg")
(check-equal? (lens-set 1-5-6-lens "abcdefg" "BFG")
"aBcdeFG")
(lens-view 1-5-6-lens "abcdefg")
(lens-set 1-5-6-lens "abcdefg" "BFG")
]}

View File

@ -8,7 +8,7 @@
Returns a lens that views an element of a vector.
@lenses-unstable-examples[
(lens-view (vector-ref-lens 2) #(a b c d))
(lens-set (vector-ref lens 2) #(a b c d) "sea")
(lens-set (vector-ref-lens 2) #(a b c d) "sea")
]}
@defproc[(vector-ref-nested-lens [i exact-nonnegative-integer?] ...) lens?]{
@ -24,8 +24,6 @@ Like @racket[list-refs-lens], but for vectors.
Equivalent to @racket[(lens-join/vector (vector-ref-lens i) ...)].
@lenses-unstable-examples[
(define 1-5-6-lens (vector-pluck-lens 1 5 6))
(check-equal? (lens-view 1-5-6-lens #(a b c d e f g))
#(b f g))
(check-equal? (lens-set 1-5-6-lens #(a b c d e f g) #(1 2 3))
#(a 1 c d e 2 3))
(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))
]}