provide and add docs

This commit is contained in:
AlexKnauth 2015-12-03 18:01:22 -05:00
parent 0b02692350
commit 5c413bd1b3
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#lang scribble/manual
@(require lens/private/doc-util/main)
@title{Lenses for nested data}
@defmodule[unstable/lens/define-nested]
@defform[(define-nested-lenses [base-id base-lens-expr] clause ...)
#:grammar ([clause [sub-id sub-lens-expr]])]{
A shorthand for defining composed lenses for nested data structures.
For example, if there is a @racket[top] struct containing a
@racket[middle] struct, which contains an @racket[x] field and a
@racket[y] field, a form like:
@(racketblock
(define-nested-lenses [top-middle top-middle-lens]
[x middle-x-lens]
[y middle-y-lens]))
Will define @racket[top-middle-x-lens] and @racket[top-middle-y-lens]
as @racket[(lens-thrush top-middle-lens middle-x-lens)] and
@racket[(lens-thrush top-middle-lens middle-y-lens)].
}

View File

@ -1,5 +1,6 @@
#lang reprovide
"arrow.rkt"
"define-nested.rkt"
"dict-nested.rkt"
"hash-filterer.rkt"
"if.rkt"

View File

@ -13,6 +13,7 @@ this library being backwards-compatible.
@(include-sections
"arrow.scrbl"
"define-nested.scrbl"
"dict-nested.scrbl"
"hash-filterer.scrbl"
"if.scrbl"