Rename struct-lens module
This commit is contained in:
Jack Firth 2015-07-07 16:46:38 -07:00
commit eb8da3b0c9
3 changed files with 4 additions and 5 deletions

View File

@ -15,6 +15,6 @@ source code: @url["https://github.com/jackfirth/lens"]
@include-section["base/main.scrbl"]
@include-section["list/main.scrbl"]
@include-section["struct-lens.scrbl"]
@include-section["struct.scrbl"]
@include-section["syntax.scrbl"]
@include-section["applicable.scrbl"]

View File

@ -3,22 +3,21 @@
@(require scribble/eval
"lenses-examples.rkt"
(for-label lens
lens/struct-lens
lens/struct
racket/base
racket/contract))
@title{Struct lenses}
@defmodule[lens/struct-lens]
@defmodule[lens/struct]
@defform[(struct-lens struct-id field-id)]{
Returns a lens for viewing the @racket[field-id] field of
a @racket[struct-id] instance.
@lenses-examples[
(require lens/struct-lens)
(require lens/struct)
(struct foo (a b c) #:transparent)
(lens-view (struct-lens foo a) (foo 1 2 3))
(lens-set (struct-lens foo a) (foo 1 2 3) 100)
]}