Merge pull request #76 from jackfirth/fix-struct-lens-#46
Rename struct-lens module
This commit is contained in:
commit
eb8da3b0c9
|
@ -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"]
|
||||
|
|
|
@ -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)
|
||||
]}
|
||||
|
Loading…
Reference in New Issue
Block a user